简体   繁体   English

Twitter Bootstrap 3模态窗口OnScroll事件

[英]Twitter Bootstrap 3 Modal Window OnScroll Event

I want to trigger something to fire functions inside Bootstrap modal window when user scroll page: 当用户滚动页面时,我想触发一些东西来启动Bootstrap模式窗口内的功能:

I've tried 我试过了

$(document).on('scroll', '.modal-scrollable', function(){
CheckFunction(); 
});

and

$('body').scroll(function(){
CheckFunction();
});

with no luck. 没有运气。 What may i do 我该怎么办

So you need to fire something when the user scrolls the content inside the modal. 因此,当用户在模式内滚动内容时,您需要触发一些操作。 then bind the scroll event to the modal content like this 然后像这样将滚动事件绑定到模式内容

$( ".modal-content" ).scroll(function() {
//fire event here
})

also set the height of the model content and set overflow:scroll that way the model becomes scrollable. 还可以设置模型内容的height ,并设置overflow:scroll ,以使模型可滚动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM