Javascript 无法使用鼠标滚轮js防止滚动父对象

Javascript 无法使用鼠标滚轮js防止滚动父对象,javascript,jquery,html,scroll,mousewheel,Javascript,Jquery,Html,Scroll,Mousewheel,在最新的Google Chrome中,我试图阻止家长使用鼠标滚轮滚动,但没有效果。所以我需要一些代码的解释 $(function() { var toolbox = $('#68').find('.medium-folder-body'), //The medium-folder-body height - 500px here height = toolbox.height(), //scrollHeight 693px (I got the height but don't unde

在最新的Google Chrome中,我试图阻止家长使用鼠标滚轮滚动,但没有效果。所以我需要一些代码的解释

$(function() {


var toolbox = $('#68').find('.medium-folder-body'),

//The medium-folder-body height - 500px here
height = toolbox.height(),

//scrollHeight 693px (I got the height but don't understand what is that for)
//what is .get(0) ?
scrollHeight = toolbox.get(0).scrollHeight;

toolbox.bind('mousewheel', function(e, d) {

//This is js question which I don't understand often - What is 'this'?
//Second question. What is d?
    if((this.scrollTop === (scrollHeight - height) && d < 0) || (this.scrollTop === 0 && d > 0)) {
      alert(this.scrollTop);
    }
  });

});
$(函数(){
var toolbox=$(“#68”).find(“.medium文件夹正文”),
//中等文件夹正文高度-此处为500px
高度=工具箱。高度(),
//scrollHeight 693px(我得到了高度,但不明白那是干什么用的)
//什么是。获取(0)?
scrollHeight=toolbox.get(0).scrollHeight;
bind('mousewheel',函数(e,d){
//这是一个我不太理解的问题——什么是“这”?
//第二个问题,d是什么?
if((this.scrollTop==(scrollHeight-height)&&d<0)| |(this.scrollTop==0&&d>0)){
警报(此为.scrollTop);
}
});
});
html非常混乱。我在这里说得很简单

<div class="folder">
   <div class="header"></div>
   <div class="medium-folder-body">
     <ul class="photo-lists></ul>
   </div>
   <div class="footer"></div>
</div>


您没有包括处理鼠标滚轮滚动方向数据的附加插件:

<script src="https://github.com/brandonaaron/jquery-mousewheel/raw/master/jquery.mousewheel.js"></script>


@ExplosionPills Html添加了非常混乱的Html,我做到了simple@ExplosionPills忘记提及,滚动到顶部工作,但到达底部不工作意味着将滚动parent@ExplosionPills这是什么意思?它实际上阻止了。只是我的不起作用我做了@vzhen你确定它被包括在内(并且在正确的时间)?你有你网站的链接吗?没有,它在本地主机上,是的,绝对是在正确的时间。有趣的是,它现在起作用了。我不知道为什么,可能是打字错误还是什么?哈哈,无论如何,谢谢你抽出时间。