`-webkit-overflow-scrolling: touch` broken for initially offscreen elements in iOS7

前端 未结 2 438
野性不改
野性不改 2020-12-02 09:00

Seeing as GM seed has been released, we can talk about it now!

Looks like in iOS7 \"-webkit-overflow-scrolling: touch\" is broken. touch events for elements that ar

相关标签:
2条回答
  • 2020-12-02 09:36

    Looks like there is a workaround to this problem on apple dev forums

    So many thanks to Mr Baicoianu.

    Basically you need to listen to touch events on the parent scroll div. So in my case add:

    document.getElementById("scrollbox").addEventListener('touchstart', function(event){});
    

    to the onBodyLoad function.

    I guess this is some event propagation issue, solved by listening at a higher level.

    0 讨论(0)
  • 2020-12-02 09:44

    The above answer works a treat for me. Here is the jQuery version of the above fix:

    $('#scrollbox').on('touchstart', function(event){});
    
    0 讨论(0)
提交回复
热议问题