Try using .one()
:
$(window).one('scroll',function() {
// Stuff
})
Or, unlink the event inside:
$(window).on('scroll',function() {
// After Stuff
$(window).off('scroll');
});
Guess you might need this code:
// this will check if element is in viewport
function checkVisible(elm, eval) {
eval = eval || "object visible";
var viewportHeight =
…
Top comments (0)