问题
This is a two part question. I building a web page and I need to know:
- Is there a way to detect if IE has smooth scrolling enabled (if so, how)?
- 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:
- No
- 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