Jquery mouseout Infinite Call problem

Source: Internet
Author: User

<div id= "Xinwen_bottom"  class= "Xinwen_bottom" ><div id= "Xinwen_msg_bground"  class= "Xinwen_msg_bground" ></div><div id= "xinwen_msg"  class= "xinwen_msg" ><div id= " Xinwen_msg_left " class=" Xinwen_msg_left "><a id=" Xinwen_desc " class=" Xinwen_desc ">< Strong> copyright law has changed </strong></a></div><div id= "Xinwen_msg_right"  class= "xinwen_msg _right "><a href=" # " onclick=" Return false "></a><a href= "#"  onclick= "Return false" ></a><a href= "#"  onclick= "Return false" >< Img class num=4 src= "Pic/news/circle.jpg"  onmouseover= "News_tiny_selector (4)" ></a ><a href= "#"  onclick= "Return false" ></a><a href=" # " onclick=" Return false "></a><a  href= "#"  onclick= "Return false" ></a></div></div></div>

HTML code as above, is ready to do when the mouse hover in the xinwen_bottom when the screen does not perform interval, when the mouse moved out of xinwen_bottom time to continue to perform setinterval time for the picture carousel, before the code is as follows:

$ ("Div.xinwen_bottom"). Mouseout (function () {alert (1); });

Discover Infinite trigger mouseout.

It is found that mouseout is not only used for this element, but also for child and grandchild elements, so it will be triggered indefinitely. Problem solving after switching to MouseLeave

$ ("Div.xinwen_bottom"). MouseLeave (function () {alert (1); });

Summary: Mouseout acts on this and child elements as well as the grandchild element. MouseLeave is used only for this element.

This article is from the "Echo and you take off" blog, please be sure to keep this source http://5052416.blog.51cto.com/5042416/1637728

Jquery mouseout Infinite Call problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.