listen to mouse hold event on website?

前端 未结 4 867
無奈伤痛
無奈伤痛 2020-12-15 09:16

I know \'mousedown\' is when user press the mouse, \'mouseup\' is when user release the mouse. But I want to listen the event after user press the mouse and hold it until it

4条回答
  •  被撕碎了的回忆
    2020-12-15 09:33

    From jquery.com :

    HTML :

    Press mouse and release here.

    Script:

    $("p").mouseup(function(){
        $(this).append('Mouse up.');
    }).mousedown(function(){
        $(this).append('Mouse down.');
    });
    

    Full url : http://api.jquery.com/mousedown/

提交回复
热议问题