Why does a fixed background-image move when scrolling on IE?

前端 未结 11 1418
时光取名叫无心
时光取名叫无心 2020-12-29 06:37

I\'m trying to make background-image fixed.

As you see in my blog, the background-image is moving when scrolling on IE 11.

How can

11条回答
  •  我在风中等你
    2020-12-29 07:34

    I have tried to disable some of css rules on your site and when I remove background property (background:#fff;) for html tag then page is scrolling smoothly. Please, try it and tell if it works for you.

    Update:

    I have also found workaround here:

    $('body').on("mousewheel", function () {
      event.preventDefault();
    
      var wheelDelta = event.wheelDelta;
    
      var currentScrollPosition = window.pageYOffset;
      window.scrollTo(0, currentScrollPosition - wheelDelta);
    });
    

提交回复
热议问题