mad334
mad334

Reputation: 1

jQuery scroll event not firing

Scroll event not firing. Using jQUery 1.11.1 . Tried it this way :

$(document).on( 'scroll', '#ulId', function(){
    console.log('Event Fired');
});



$(document).on( 'scroll', '#idOfDivThatContainsULandScroll', function(){
    console.log('Event Fired');
});

I'm also using CSS . Is there any possibility , CSS is blocking this event to ?

This fills $pos:

$(window).bind("scroll", function(e) {
var $pos = $(window).scrollTop()
});

Any idea how I can trigger this event?

Upvotes: 0

Views: 2382

Answers (1)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85545

As @adeneo:

The scroll event doesn't bubble, and can't be delegated.

Use like this:

$(window).on( 'scroll', function(){
    console.log('Event Fired');
});

Upvotes: 1

Related Questions