Home>

The header is fixed at position: fixed, and when scrolling, only IE11 and Edge will rattle.

If i embed js written on the following site
IE11 is no longer rattling, but only Edge is still rattling.
https://souken-blog.com/2017/08/25/ie11-smoothscroll/
http://cloud-collector.link/2016/05/08/ie-fixed-scroll-bug/

<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>

Is the user agent different from Edge?
I'm struggling without knowing the cause.

Is there any good way to prevent edge rattling?

  • Answer # 1

    The Edge user agent looks likematch (/ Edg /)

    Edge's user agent is terrible

    The scroll event can be taken even when the body is fixed

    I want to change the background color of the fixed header by scrolling | StackOverflow

Related articles