如何使用 jQuery 处理双击事件?
jqueryweb developmentfront end technology
要使用 jQuery 处理双击事件,请使用 dblclick() 事件。当元素被双击时,会触发此事件。
示例
您可以尝试运行以下代码,学习如何使用 jQuery 处理双击事件。
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("p").dblclick(function(){
alert("You have clicked this twice.");
});
});
</script>
</head>
<body>
<p>Double click</p>
</body>
</html>

