Disable mouse double click using javascript or jquery

前端 未结 5 2008
借酒劲吻你
借酒劲吻你 2021-01-05 07:17

I have a form in which i have some text boxes and below to it there is a table.When i double click on table row it takes me to another page.

Now the problem is if i

5条回答
  •  清酒与你
    2021-01-05 08:00

    As said here, use a capture phase event listener:

    document.addEventListener( 'dblclick', function(event) {  
        alert("Double-click disabled!");  
        event.preventDefault();  
        event.stopPropagation(); 
      },  true //capturing phase!!
    );

提交回复
热议问题