我在jquery中使用鼠标滚轮来增加div的数量,数字正确增加但是在Firefox中没有停止滚动.
$(document).ready(function(){
$('#test').bind('mousewheel DOMMouseScroll', function(event){
var currentValue = parseInt($('#test').text(),10),
newValue = currentValue + 1;
$('#test').text(newValue);
event.preventDefault();
});
});
Run Code Online (Sandbox Code Playgroud)
小提琴:http://jsfiddle.net/rHVUn/
小提琴使用标准鼠标滚轮检测,但我也使用了Brandon Aaron的鼠标滚轮插件,它也有同样的问题.
删除更新文本的行(我也尝试过html())解决了问题,但这是代码的关键部分,无法删除.
有谁知道如何解决这个问题?
谢谢
更新:我发现问题只发生在我的鼠标直接放在文本上方,如果我的鼠标在框内而不是在文本上(在填充内)滚动停止