bootstrap-modal icon indicating copy to clipboard operation
bootstrap-modal copied to clipboard

How to detect scroll events with modalOverflow?

Open andyg2 opened this issue 12 years ago • 1 comments

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

andyg2 avatar Sep 13 '13 10:09 andyg2

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 });

andyg2 avatar Sep 14 '13 09:09 andyg2