-->

Internet Explorer Smooth Scrolling Detection

2019-07-13 12:35发布

问题:

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