How to detect scroll events with modalOverflow?
I have a number of tooltips a date pickers used in my modal. How can I detect if the overflow modal has been scrolled so I can either reposition any open floating elements and reposition them according to the modal scroll position? Thx
OK, I sorted it. The scroll event doesn't propagate to the document level of the DOM so $(document).on doesn't work. I got around it with this hack.
This did work.
$(document).on("shown", "#modalcontact", function() { $(".modal-scrollable").unbind("scroll"); $(".modal-scrollable").scroll(function(){ //do stuff }); });
This didn't work.
$("#modalcontact").modal({
shown: function (){
$(".modal-scrollable").scroll(function(){
//do stuff
});
}
});
This didn't work either.
$(document).on("scroll", ".modal-scrollable", function(){ //do stuff });