<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <button>按钮</button> <script src="jquery.js"></script> <script> $(function () { var time =null; $("button").click(function () { clearTimeout(time); time = setTimeout(function () { console.log("单机") },300); }) $("button").dblclick(function () { clearTimeout(time); console.log("双击") }); }) </script> </body> </html>
解决单双击冲突
猜你喜欢
转载自www.cnblogs.com/lxx7/p/9761204.html
今日推荐
周排行