You probably forgot to give # before the identifier for the identifier selector, you need to give # before the id , i.e. will be ulId
You probably need to bind the scroll event to a div that contains ul and scrolls. You need to bind the event with a div instead of ul
$(document).on( 'scroll', '#idOfDivThatContainsULandScroll', function(){ console.log('Event Fired'); });
Edit
The above will not work, because the scroll event does not pop up in the DOM, which is used to delegate the event, see this question why not delegate the work to scroll?
But with modern browsers> IE 8, you can do it the other way. Instead of delegating using jquery, you can do this by capturing events using the java script document.addEventListener with the third argument as true ; See how bubbles and traps work in this tutorial .
Real time demo
document.addEventListener('scroll', function (event) { if (event.target.id === 'idOfUl') {
If you do not need to delegate the event, you can bind the scroll event directly to ul, rather than delegating it through document .
Real time demo
$("#idOfUl").on( 'scroll', function(){ console.log('Event Fired'); });
Adil Oct. 15 '13 at 7:36 on 2013-10-15 07:36
source share