hover() 方法规定当鼠标指针悬停在被选元素上时要运行的两个函数。方法触发 mouseenter 和 mouseleave 事件。ps: 如果只指定一个函数,则 mouseenter 和 mouseleave 都执行它。
$(selector).hover(function1,function2)
其中:
selector是jQuery的选择器;
function1是jQuery hover触发的mouseenter方法(必需);
function2是jQuery hover触发的mouseleave方法(非必需);
$("p").hover(function(){ alert("hello world1"); },function(){ alert("hello world2"); });
学习不止眼前的笔记与教程,还需实践和创新呦~
服务器2021-02-15
服务器2021-02-14
jQuery2021-02-13
jQuery2021-02-12
jQuery2021-02-11
jQuery2021-02-10