zcynine

 

长按原生js写法

<script>  
    var num = 0 ;   
    function whichElement(e){  
        var timer_alert = setTimeout(function() {  
            if(e.which==1) {  
                num++  
                if(num==2){  
                    num=0;   
                    alert( "鼠标长按" );   
                }else{  
                    whichElement( e );  
                }  
            }  
        }, 1000) ;  
    }  
</script>

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-12-05
  • 2021-12-15
  • 2021-12-05
  • 2021-12-31
  • 2021-08-01
  • 2021-12-25
猜你喜欢
  • 2021-12-15
  • 2022-12-23
  • 2021-06-23
  • 2021-12-05
  • 2021-12-15
  • 2021-12-15
  • 2021-06-14
相关资源
相似解决方案