The function: I want to change the class of a certain item when a user see a certain div (scrolls down to it).
How I do it now: I\'
to judge the div is visible or not, you can:
$(window).scroll(function(event) {
console.log($(".target").offset().top < $(window).scrollTop() + $(window).outerHeight());
});
so, i don't think you need any plugin.
just judge it by the expression like:
if($(".target").offset().top < $(window).scrollTop() + $(window).outerHeight()) {
// something when the .target div visible
} else {
// something when the .target div invisible
}