IOS 5 (safari) bug with HTML touch events on “position:fixed” div

前端 未结 7 2069
执念已碎
执念已碎 2021-02-05 22:32

I have a position:fixed div on a scrolling web page.

At first the event works, but when the page scroll, while the fixeed divs stays in place, its \"touch\" zone seems t

7条回答
  •  时光取名叫无心
    2021-02-05 22:36

    I found a relatively strange solution to this bug. By adding a touchstart event listener and a blank event handler, it somehow seems to move the touch area on manual touch. I do not know if this is a solution for the JavaScript scroll issue.

    Code:

    document.getElementsByTagName("body")[0].addEventListener("touchstart",function(){});
    

    Credit for finding this method goes to pamelafox in this github bug discussion.

提交回复
热议问题