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:
$(window).on('scroll',function() {
if (checkVisible($('#tester'))) {
alert("Visible!!!");
$(window).off('scroll');
} else {
// do nothing
}
});
Fiddle: http://jsfiddle.net/c68nz3q6/
Top comments (0)