Internet Explorer Smooth Scrolling Detection

别等时光非礼了梦想. 提交于 2019-12-23 16:21:53

问题


This is a two part question. I building a web page and I need to know:

  1. Is there a way to detect if IE has smooth scrolling enabled (if so, how)?
  2. Is there a way to force IE to turn off smooth scrolling for my web page?

To be clear, I'm not asking how to turn off smooth scrolling for the whole computer. I am the developer developing a web page that will only work properly if smooth scrolling is disabled.


回答1:


  1. No
  2. No

In conclusion, IE sucks. ;)




回答2:


I'm just chirping in here 5 years later...

You can remove smooth scrolling in IE if you manually override the event yourself.

if(navigator.userAgent.match(/Trident\/7\./)) {
    $('body').on("mousewheel", function () {
        event.preventDefault();
        var wd = event.wheelDelta;
        var csp = window.pageYOffset;
        window.scrollTo(0, csp - wd);
    });
}

This was sufficient for me to resolve my IE smooth scrolling issues. Blatantly stolen from Here



来源:https://stackoverflow.com/questions/9117426/internet-explorer-smooth-scrolling-detection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!