onclick and ontouchstart simultaneously

后端 未结 6 1923
花落未央
花落未央 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 21:49

    I just came up with the idea to just memorize if ontouchstart was ever triggered. In this case we are on a device which supports it and want to ignore the onclick event. Since ontouchstart should always be triggered before onclick, I'm using this:

    
    

提交回复
热议问题