0

I am trying to disable IE11 smooth scrolling with the following code. Right after implementation, I could scroll smoothly but the next day I can't. There seems to be other similar topics, but None of them work. The os is Win10. What should I do next?

<script>
if(navigator.userAgent.match(/MSIE 10/i) || navigator.userAgent.match(/Trident\/7\./) || navigator.userAgent.match(/Edge\/12\./)) {
        $('body').on("mousewheel", function () {
        event.preventDefault();
        var wd = event.wheelDelta;
        var csp = window.pageYOffset;
        window.scrollTo(0, csp - wd);
        });
        }
</script>
mazaka
  • 5
  • 4
  • Just tested it with Internet Explorer 11 and it works like expected. – SaschaM78 Jun 03 '20 at 13:23
  • Your description is a little confusing. Can you please inform us, how exactly did you try to test it? It can give the proper idea about the issue. You can try to refer to these threads. It can be helpful. https://stackoverflow.com/questions/29416448/how-to-disable-smooth-scrolling-in-ie11 and https://stackoverflow.com/questions/31264290/how-to-disable-smooth-scrolling-in-ie-11-programatically?rq=1 – Deepak-MSFT Jun 03 '20 at 15:06
  • It fails in my IE11.I also referred to the above two topics and tested it, but the results were same. – mazaka Jun 04 '20 at 07:10
  • The test method is simple.  Write a script before the body tag of WordPress theme, then I tested scrolling on the certain page. – mazaka Jun 04 '20 at 07:27
  • I am not available with Wordpress to test the above code with it. Is it possible to produce an issue using simple HTML? If yes, please share your sample code. In my test results, I did not see any issue. Thanks for your understanding. – Deepak-MSFT Jun 04 '20 at 09:53
  • At the simplified HTML, I can scroll smoothly without script.Does that mean that Wordpress is the cause?Sorry,there are too many characters to post here. – mazaka Jun 05 '20 at 02:13
  • I am not sure whether the issue caused by the Wordpress site. If you can post your sample code by editing the original post then we can try to test it with the IE 11 browser. The already posted code in the original post works without any issue on my side. – Deepak-MSFT Jun 08 '20 at 15:40

0 Answers0