Reputation: 1056
I am trying to use lazyload on a page.
The code i have is:
$(function() {
$("img.lazy").lazyload();
});
However i want it to ignore all images that have the class "notlazy". How do i put a condition in the selector?
Thanks in advance, sorry for this primitive question.
Upvotes: 14
Views: 19873
Reputation: 41822
Try:
$('img.lazy').not('.notlazy')
There are a few other ways...
$('img.lazy:not(.notlazy)')
$('img.lazy').filter(function() {return !$(this).hasClass('notlazy');});
Upvotes: 34