jquery给元素绑定hover事件,在event事件中判断 鼠标移动进入和移除的效果!代码是:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/8154.html
1 2 3 4 5 6 7 8 9 | $( "#user-home-menu" ).live( "hover" , function (event){ if (event.type== 'mouseenter' ){ $( this ).find( "span" ).addClass( "hover" ); $( this ).find( "div" ).show(); } else { $( this ).find( "span" ).removeClass( "hover" ); $( this ).find( "div" ).hide(); } }); |
文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/8154.html
文章源自菜鸟学院-https://www.cainiaoxueyuan.com/gcs/8154.html