Double tap on mobile safari

后端 未结 3 1036
南笙
南笙 2021-01-02 15:56

Is there a way to bind to a double-tap event (in a single line of code) for mobile safari? Or, the alternative is to implement it intercepting two single-tap events that hap

3条回答
  •  梦毁少年i
    2021-01-02 16:28

    Short answer: you must implement via two clicks.

    Actual answer: Here is a jQuery-free implementation of double-tap for mobile safari which only requires one line of code (to enable dblclick event):

    • https://gist.github.com/2927073

    In addition, you will likely need to disable mobile Safari's default zoom with this meta tag:

    
    

提交回复
热议问题