I'm currently trying to write a jquery script that shows only the first 5 list items. What is bothering me is how to make the script show next 5 elements if you click on the loadmore button. Below is the jquery code i am working with. I guess that i need to add plus 5 to the variable x, but i don't know how to do that correclty, and make the next 5 list items show.
jQuery(document).ready(function () {
jQuery('.layered-items').each(function(){
var size = jQuery(this).find('li').length;
var x = 5;
jQuery('li:lt('+x+')', this).show();
jQuery('.loadmore-filter').click(function(){
})
})
});
Any suggestions? :)