onclick and ontouchstart simultaneously

后端 未结 6 1920
花落未央
花落未央 2021-02-08 21:23

I have an ontouchstart event triggered on my mobile view, its linked to this:

function mobileLinksShow() {
    document.querySelector(\'.mobile-head         


        
6条回答
  •  日久生厌
    2021-02-08 22:08

    You can bind a function to ontouchstart which calls whatever is bound to onclick, but then prevents default so that it doesn't actually also trigger onclick.

    You can then easily copy paste this ontouchstart event to all places where you use onclick.

    
    
    
    

提交回复
热议问题