1. The Mouseout event is triggered regardless of whether the mouse pointer leaves the selected element or any child elements.
2. The MouseLeave event is triggered only when the mouse pointer leaves the selected element.
Copy Code code as follows:
The essential differences between mouseenter/mouseleave and mouseover/mouseout are described on the Internet. However, the explanations are in the fog of the cloud, their difference it differs in that it doesn't bubble and that it isn't sent when the pointer is moved from one of its descendants 'physical space to its own physical space is introduced from mozilla.org
The above sentence is separated by different colors for easy understanding.In essence,
The MouseOver event is triggered regardless of whether the mouse pointer passes through the selected element or its child elements.The MouseEnter event is triggered only when the mouse pointer passes through the selected element.The test code is as follows:The results are as follows:The difference is whether the child element can trigger the function!The difference between mouseover and MouseEnter, Mouseout and MouseLeave
when the mouse enters div1, The Mouseover event is triggered, because btn1 and btn2 are child elements enclosed in div1, The Mouseover event is triggered when the mouse moves from the DIV to the child element btn1, when the mouse moves from btn1 to
Last night, I had a project requirement. Now I need to put the mouse on the link and show the layer. After I leave the link, I can hide the layer. The trouble is that when I move the mouse over the upper layer, this layer will always show, leave
The effects and code ideas to achieveIn simple terms, a div wrapped with a horn and a hover box hover event is written on this div when the mouse hovers over the DIV and the hover box appears.The bottom box will not disappear when the mouse is moved
original event to determine whether to prevent the default event action from occurring and whether to stop the bubbling event and pass it up.
③ The target is corrected, and srcElement is used in IE. For text node events, the target should be uploaded to its parent node.
④ RelatedTarget is only useful for mouseout and mouseover. In IE, the Target variables "to" and "from" are divided, which are not separated in mozilla. To ensure compatibility, use re
methods to prevent the default event action from occurring and whether to stop bubbling event events up-pass.
③ is fixed target, IE uses srcelement, and for text node events, Target should be uploaded to its parent node.
④ Place Relatedtarget only for mouseout, mouseover useful. In IE, the to and from two target variables are divided in Mozilla. In order to ensure compatibility, the use of Relatedtarget unified.
The ⑥ place is the coordinate posit
Mouse events are the most important events so far. In this chapter, I will introduce some of the most common problems and tips for mouse events. First, let's take a look at the mouse events: mousedown, mouseup_and_click, dblclick, mousemove, and mouseover mouseout. Then, we will explain the event attributes such as relatedTarget, fromElement, and toElement. The last is Microsoft's mouseenter and mouseleave events.
For browser compatibility issues, se
First look at what mouse events are available: Mousedown,mouseup_and_click,dblclick,mousemove and MouseOver mouseout. Then you'll explain the relatedtarget,fromelement and toelement these event properties. Finally, Microsoft's MouseEnter and MouseLeave events.
Compatibility issues with browsers, which can be viewed in the browser compatibility List.
Example
Here's an example. can help you understand the content below.
Mousedown,mouseup,click and D
First, let's take a look at the mouse events: mousedown, mouseup_and_click, dblclick, mousemove, and mouseover mouseout. Then, we will explain the event attributes such as relatedTarget, fromElement, and toElement. The last is Microsoft's mouseenter and mouseleave events.For browser compatibility issues, see the browser compatibility list.Example Here is an example. This helps you understand the following content.Mousedown, mouseup, click, and dblclic
First, let's take a look at the mouse events: mousedown, mouseup_and_click, dblclick, mousemove, and Mouseover mouseout. Then, we will explain the event attributes such as relatedtarget, fromelement, and toelement. The last is Microsoft's mouseenter and mouseleave events.
For browser compatibility issues, see the browser compatibility list.
Example Here is an example. This helps you understand the following content.Mousedown, mouseup, click, an
Solves the problem of onmouseout event triggered by mouse passing through internal elements.
Recently, when I made a JS effect, I found this problem:
When the mouse moves to the IMG inside the Div or other elements, the internal element Mouseover event is triggered. However, when you move the cursor to another internal element inside the DIV,
The first trigger is the mouseout event of the DIV, followed by the Mouseover event of the current element.
Ba
Simple Mouse Movement Events:EnterMouseEnter: No bubbling mouseover: Bubbles trigger The MouseOver event whenever the mouse pointer crosses the selected element or its child elements the MouseEnter event is triggered only when the mouse pointer passes through the selected elementMove outMouseLeave: No bubbling mouseout: Bubbles trigger The Mouseout event whenever the mouse pointer leaves the selected elemen
Simple Mouse Movement Events:
Enter
Copy Code code as follows:
MouseEnter: Not bubbling
MouseOver: Bubbling
The MouseOver event is triggered regardless of whether the mouse pointer crosses the selected element or its child elementsThe MouseEnter event is triggered only when the mouse pointer crosses the selected element
Move out
Copy Code code as follows:
MouseLeave: Not bubbling
Mouseout: Bubbling
JavaScript and JQuery mouse event bubble Processing
This article mainly introduces the mouse and mouse event bubbling processing of JavaScript and JQuery. This article summarizes some conclusions about the mouse event and provides the JavaScript and JQuery Test Code respectively, for more information, see
Simple mouse movement event:
Enter
The Code is as follows:
Mouseenter: Do not bubble
Mouseover: Bubble
The mouseover event is triggered no matter the mouse pointer passes through the selected e
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.