For example, after using AJAX, I'll have a scrollable DIV. How to bind scroll events to it?
I've tried:
$(window).on("scroll", ".mydiv", function(){...})
$(document).on("scroll", ".mydiv", function(){...})
$(".mydiv").on("scroll", function(){...})
$(".mydiv").scroll(function(){...})
But they didn't work.
I'm having the same issue and I've found the following in the jQuery .on() API:
So unfortunately this doesn't appear to be possible.
try this modified from your code
http://jsfiddle.net/apDBE/
Hope this help
It's work by attaching
on
directly, check example bellow.Hope this helps.