Conditionally block scrolling/touchmove event in mobile safari

后端 未结 6 1539
暗喜
暗喜 2021-02-03 13:46

iOS 5 now allows native overflow: scroll support.

What I\'d like to do is disable the touchmove event for everything except elements that have the \'scrolla

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-03 14:23

    I know it's been a while since you asked the question, but I had the same issue and I used your code as the basis for solving the problem. So thanks for the inspiration.

    (Javascript + jQuery)

    
    

    Or less verbose, but ultimately the same result (credit J Griffiths):

    
    

    You should also include the following META tag.

    
    

提交回复
热议问题