onmouseover: 鼠标滑入,冒泡。 |
onmouseout: 鼠标滑出,冒泡。 |
onmouseenter: 鼠标滑入,不冒泡。 |
onmouseleave: 鼠标滑出,不冒泡。 |
onmouseenter、onmouseover: Fires when the user moves the mouse pointer into the object.
onmouseenter fires only if the mouse pointer is outside the boundaries of the object and the user moves the mouse pointer inside the boundaries of the object. If the mouse pointer is currently inside the boundaries of the object, for the event to fire, the user must move the mouse pointer outside the boundaries of the object and then back inside the boundaries of the object.
Unlike the onmouseover event, the onmouseenter event does not bubble. In other words, the onmouseenter event does not fire when the user moves the mouse pointer over elements contained by the object, whereas onmouseover does fire.
onmouseleave、onmouseout: Fires when the user moves the mouse pointer outside the boundaries of the object.
onmouseleave fires only if the mouse pointer is inside the boundaries of the object and the user moves the mouse pointer outside the boundaries of the object. If the mouse pointer is currently outside the boundaries of the object, for the event to fire, the user must move the mouse pointer inside the boundaries of the object and then back outside the boundaries of the object.