javascript - Continuous clicks trigger mouseleave event
黄舟
黄舟 2017-07-05 10:37:55
0
2
1073
<!DOCTYPE html>
<html>

<head lang="en">
  <meta charset="UTF-8">
  <title>test</title>
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>

<body>
  <p class="main" style="width:100px;height: 200px;background: red;"></p>
  <script>
    $(".main").mouseleave(function() {
      alert(0)
    })
  </script>
</body>

</html>

At first I thought it was a conflict with the click event in .main, but I found that continuous clicks of the mouse will also trigger the mouseleave event.

Please tell me if you have any solution.

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
某草草

My continuous mouse clicks here did not trigger the mouseleave event. You can put the code to see http://runjs.cn/code

为情所困

If you simply click the left button continuously, there is no problem, but if you click the right button or alternate left and right, some situations may occur because the menu is called out

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template