Jquery onmouseout 冒泡问题
在一个DIV 中做 遮罩 层时,一般多用于 浮动广告或者 是菜单特效。其中 onclick 和 onmouseout 会有冲突,请看下面代码:
<script type="text/javascript">
jQuery("#demo1").scrollFollow({
offset: 156
});
jQuery("#demo1").click(function(){
jQuery("#demo1").css('width','1000px');
jQuery("#new_index_huodong").show();
var width = document.body.clientWidth;
var height = document.body.clientHeight;
jQuery("#main_bg").css('height',height+'px');
jQuery("#main_bg").css('width',width+'px');
jQuery("#main_bg").show();
jQuery("#new_index_img").hide();
});
jQuery("#demo1").mouseout(function(){
jQuery("#demo1").css('width','33px');
jQuery("#new_index_huodong").hide();
jQuery("#main_bg").hide();
jQuery("#new_index_img").show();
});
</script>
<!-- //jquery 滚动 -->
其它网上说的方法太麻烦了,Jquery 有更简单的方法
mouseleave()
当鼠标指针离开元素时,会发生 mouseleave 事件。
- 上一篇:form 纯js 判断 radio 是否选择
- 下一篇:js 控制浏览器全屏