大佬教程收集整理的这篇文章主要介绍了jquery – Mouseenter在mouseenter内部或外部?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
$(document).ready(function(){ $('div').mouseenter(function(){ $(this).fadeTo('fast','1'); $(this).mouSELEave(function(){ $(this).fadeTo('fast','0.25'); }); }); });
或者这个1更好?
$(document).ready(function(){ $('div').mouseenter(function(){ $(this).fadeTo('fast','1'); }); $('div').mouSELEave(function(){ $(this).fadeTo('fast','0.25'); }); });
mouseenter
时,您的第一个选项都会添加一个新的
mouseleave
事件,从而导致许多附加事件.所以使用:
$('div').mouseenter(function () { $(this).fadeTo('fast','fast'); }); $('div').mouSELEave(function () { $(this).fadeTo('fast','0.25'); });
在.hover(handlerIn,handlerOut)
,实际上有一些很好的速记.
$('div').hover( function () { $(this).fadeTo('fast','fast'); },function () { $(this).fadeTo('fast','0.25'); } );
以上是大佬教程为你收集整理的jquery – Mouseenter在mouseenter内部或外部?全部内容,希望文章能够帮你解决jquery – Mouseenter在mouseenter内部或外部?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。