Difference between revisions of "Template:Jilin China Menu"

Line 293: Line 293:
  
 
};
 
};
function preventBodyScroll(event){
+
var event = event.originalEvent || event;
+
if (event.wheelDelta < 0 || event.detail > 0) { // 向下滚动
+
if (this.scrollTop + this.clientHeight < this.scrollHeight) { // 未滚动到底
+
event.stopPropagation(); // 阻止事件继续冒泡
+
}
+
}
+
else { // 向上滚动
+
if (this.scrollTop > 0) { // 未滚动到顶
+
event.stopPropagation(); // 阻止事件继续冒泡
+
}
+
}
+
}
+
 
+
// document.getElementById('c1').addEventListener('mousewheel', preventBodyScroll, true);
+
// document.getElementById('c1').addEventListener('DOMMouseScroll', preventBodyScroll, true);
+
$('#c1').on('mousewheel DOMMouseScroll', preventBodyScroll);
+
                       
+
 
+
 
           </script>
 
           </script>
 
</div>
 
</div>

Revision as of 16:38, 16 October 2016

Particles