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\", functi
try this modified from your code
http://jsfiddle.net/apDBE/
$(document).ready(function(){
// Trigger
$("#btn").click(function(){
if ($(".myDiv").length == 0) // Append once
$("body").append('
Content1
Content2
');
});
// Not working
$(".myDiv").scroll(function(){
alert("A");
});
// Not working
$(document).on("scroll", ".myDiv", function(){
alert("A");
});
});
Hope this help