Skip to content Skip to sidebar Skip to footer

Jquery On Scroll Event Not Firing

I have an application with a lot ajax actions going on. So pretty much all my events are handled like this: jQuery( 'body' ).on( 'click', '#id', function ( event ) { // Do som

Solution 1:

The issue is that the scroll event does not bubble up the DOM, so delegation with live(), on() or delegate() won't work.

You will have to bind the event handler to the dynamically-created element yourself.

Reference

Solution 2:

Not sure if this helps

$(window).on('scroll', function(){
   $("#head").html($(this).scrollTop());
});

JSfiddle

Solution 3:

To be able to fire a scroll event of a DOM element, you should put this in your css:

selector { overflow-y: scroll }

Post a Comment for "Jquery On Scroll Event Not Firing"