I am making online product site, I am trigging a scroll event, at starting only 12 elements will be shown but when 8th element is scrolled to top scroll event should run onl
I think what you need is .one method
$(window).one("scroll",function(){
var scroll_top = $(window).scrollTop(); // current vertical position from the top
// if scrolled more than the navigation, change its position to fixed to stick to top, otherwise change it back to relative
if (scroll_top > sticky_navigation_offset_top)
{
console.log("Hi");
}
});
You can learn more here: http://api.jquery.com/one/