How can I pass a click through an element?

后端 未结 4 2206
时光取名叫无心
时光取名叫无心 2020-12-07 00:24

I want to display an image under the mouse (a finger to simulate a touch screen) when a mousedown event occurs and hide it when the mouseup event occurs, but when I do this,

4条回答
  •  鱼传尺愫
    2020-12-07 00:54

    You can do this

    $(document).bind('mousedown mouseup', function() {
        $('.finger').toggle();
    });
    

    Check working example at http://jsfiddle.net/2cSj4/2/

提交回复
热议问题