javascript - 页面没有滚动条如何去触发scroll事件
阿神
阿神 2017-04-10 15:07:39
0
2
350

诸如小米手机的展示页面小米手机展示页

阿神
阿神

闭关修行中......

reply all(2)
迷茫
jsvar MouseWheelHandler = function(e) {
      e.preventDefault();
      e = window.event || e;
      //do something here
}
/*
refer to fullpage.js
github: https://github.com/alvarotrigo/fullPage.js
*/
var addMouseWheelHandler = function() {
  document.addEventListener("mousewheel", MouseWheelHandler, false); 
  //IE9, Chrome, Safari, Oper
}
addMouseWheelHandler();

这是参考fullpage.js写的
简单来说就是添加鼠标滚轮滚动事件

洪涛

监听mousewhell事件就可以了,小米用的jquery.mousewhell插件

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template