0

我有一个 div 在滚动时 jQuery 事件不会触发。我已经尝试过如下以及$(".assignments-my-overflow"). 它在 IE 中运行良好,类似的代码在 Firefox 中的精简示例中运行,但是我们网站中包含的 js 或 css 中的某些内容导致它无法在 Firefox 中运行。我目前正在使用 twitter bootstrap 2.0.4。我一直在寻找preventDefault()可能会阻止它但没有看到任何明显的呼叫。有没有一种更简单的方法来弄清楚为什么它不工作,而不是一次又一次地消除一点点的 css/js/html,这有点乏味?

<div id='assignments-my-overflow' style="height:<%=percent%>; overflow:auto">

...

$("div").on("scroll", function(){
   // alert('scroll');
   console.log("scroll");
   $(".combo-input").hide();
   $(".combo-input").show();       
});    
4

1 回答 1

0

这在 Firefox 中对我有用。

http://jsfiddle.net/EvDL4/1/

$("div").on("scroll", function(){
   alert('scroll');
   $(".combo-input").hide();
   $(".combo-input").show();       
});  
于 2013-02-15T14:15:42.153 回答