press and hold button javascript

前端 未结 3 970
余生分开走
余生分开走 2021-01-25 19:31

I\'m having a problem with my button in my HTML5 application. When I press the button a Video player runs and plays the video that is stored locally. My issue now is that when I

3条回答
  •  忘了有多久
    2021-01-25 20:23

    Actually onmousedown event instead of onClick will do the trick.

    Again the same syntax:

    Javascript

    
    
    function clickFunction(){
    //code goes here
    }
    

    jQuery

    function clickFunction(){
       $(button).onmousedown(function(){
           //code goes here
       });
    };
    

提交回复
热议问题