我只是想不滚动,但是触发scroll事件而已嘛-----
然后,就是滚动,就是滚动---
$(".contain").scroll(function(event){
event.stopPropagation();
event.preventDefault();
$(this).unbind('scroll');
console.info("1");
return false;
})
$(window).scroll(function(event){
event.stopPropagation();
event.preventDefault();
$(this).unbind('scroll');
console.info("1");
return false;
})
$('body').scroll(function(event){
event.stopPropagation();
event.preventDefault();
$(this).unbind('scroll');
console.info("1");
return false;
})
$(document).scroll(function(event){
event.stopPropagation();
event.preventDefault();
$(this).unbind('scroll');
console.info("1");
return false;
})
我都这样了---为什么还是滚动?
滚动时直接设置滚动位置为0,阻止不了。阻止鼠标滚轮滚动可以用onmousewheel事件
window.onscroll=function(){document.documentElement.scrollTop=document.body.scrollTop=0}