On my page I have articles with dynamic content.
And I use two jQuery scripts to filter them
//Load more // less
$(document).ready(function () {
$('#article-list article:gt(10)').hide();
$('#loadMore').click(function () {
$('#article-list article:hidden:lt(2)').show();
});
});
//hide articles with no image
$('.myClass').each(function(){
if($(this).attr('src') === ""){
$(this).closest('article').hide();
}
});
On the first load it's okay I see 10 articles all with images.
But when I click load more it loads 2 more articles but I see articles with no image.
How can I combine those two codes so when I click load more to hide the articles with no image