IE 10 & 11 make fixed backgrounds jump when scrolling with mouse wheel

前端 未结 6 1072
不知归路
不知归路 2020-12-02 16:45

When you scroll with the mouse wheel in Windows 8 the fixed background image bounces around like crazy. This only affects IE 10 and IE 11. This affects elements with p

6条回答
  •  日久生厌
    2020-12-02 17:08

    I know it is a bit late for an answer but I've had the same problem and was able to fix it by adding these attributes to my css file

    html{
        overflow: hidden;
        height: 100%;    
    }
    body{
        overflow: auto;
        height: 100%;
    }
    

    From the comments:

    This solution stops scroll events from firing on the window, so do be careful if you're using anything that relies on such events firing. codepen.io/anon/pen/VawZEV?editors=1111 ( overflow: hidden, scroll events don't work) codepen.io/anon/pen/PNoYXY?editors=1111 ( overflow: auto, scroll events fire) - Dan Abrey

    So this might cause some problems in your projects. But I don't see another way to workaround this bug in IE.

提交回复
热议问题