$("#target").on({    
        touchstart: function(e) {   
            // 长按事件触发    
            timeOutEvent = setTimeout(function() {    
                timeOutEvent = 0;    
                alert('你长按了');    
            }, 400);    
            //长按400毫秒     
            // e.preventDefault();      
        },    
        touchmove: function() {    
            clearTimeout(timeOutEvent);    
            timeOutEvent = 0;    
        },    
        touchend: function() {    
            clearTimeout(timeOutEvent);    
            if (timeOutEvent != 0) {    
                // 点击事件    
                // location.href = '/a/live-rooms.html';    
                alert('你点击了');    
            }    
            return false;    
        }    
    })  

 

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2022-01-02
  • 2021-08-19
  • 2022-12-23
  • 2021-11-14
猜你喜欢
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
相关资源
相似解决方案