Reputation: 179
I am using the code below to allow me to fadein a div when I begin to scroll, which is assign to all of my unordered list. Is there a way I can tell the script to not assign this function to a specific ul
Example
I want all UL to fade in but would like ul class"test" to not fade, but to just be static.
tiles = $("ul li").fadeTo(0, 0);
$(window).scroll(function(d,h) {
tiles.each(function(i) {
a = $(this).offset().top + $(this).height();
b = $(window).scrollTop() + $(window).height();
if (a < b) $(this).fadeTo(500,1);
});
});
Upvotes: 0
Views: 41
Reputation: 33409
You can remove items with the .test
class from the collection using .not()
.
tiles = $("ul li").not("ul.test li").fadeTo(0, 0);
Upvotes: 1