jQuery .mouseover()
和.hover()
函数之间有什么区别?如果它们完全相同,为什么jQuery同时使用这两种语言?
jQuery .mouseover()
和.hover()
函数之间有什么区别?如果它们完全相同,为什么jQuery同时使用这两种语言?
.mouseover()
.hover()
绑定一个或两个处理器
拨打$(selector).hover(handlerIn, handlerOut)
是以下的简写:
绑定鼠标进入元素时要触发的事件处理程序,
mouseover
fires when the pointer moves into the child element as
well, while mouseenter
fires only when the pointer moves into the
bound element.
因此,.mouseover()
与.hover()
相同,.mouseover()
与.mouseenter()
相同.
$('selector').mouseover(over_function) // may fire multiple times
// enter and exit functions only called once per element per entry and exit
$('selector').hover(enter_function, exit_function)