jQuery 之间有什么区别.mouseover()
and .hover()
功能?如果它们完全相同,为什么 jQuery 同时使用两者?
来自 jQuery 官方文档
-
.mouseover()
将事件处理程序绑定到“mouseover”JavaScript 事件或触发器
元素上的该事件。
-
.hover()绑定一到两个处理程序
到匹配的元素,当鼠标指针移动时执行enters and leaves要素。
Calling $(selector).hover(handlerIn, handlerOut)
是以下形式的简写:$(selector).mouseenter(handlerIn).mouseleave(handlerOut);
这意味着什么
因为这,.mouseover()
is not与.hover()
, 为了同样的原因.mouseover()
is not与.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)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)