谁能解释下这是为毛??
回复讨论(解决方案) 加background 是为了触发layout
把 #b的position 去掉,不加background mouseleave也是可以了,问题就出现在position:absolute;
ie6解析怪异,不像dom那样依旧认识#a下面#b的width及height
ie6只会认得内容来充满box,如下:
无标题文档 1111111111111111111111
鼠标出了11111内容 box才会缩回去,所以这里加个background,让它充满整个box。
加background 是为了触发layout
把 #b的position 去掉,不加background mouseleave也是可以了,问题就出现在position:absolute;
ie6解析怪异,不像dom那样依旧认识#a下面#b的width及height
ie6只会认得内容来充满box,如下:
html code
+11
路过,学习,不同浏览器解析
推荐楼主少用jq ,需然效果好,但是浏览器有些识别不了
$(document).ready(function(e) { $(#a).mouseover(function(e) { $(#b).slidedown(); }); $(#a).mouseleave(function(e) { var to = e.relatedtarget || e.toelement;//获得鼠标移出后进入的元素 alert(to.tagname) $(#b).slideup(); }); });
去掉背景和不去掉背景分别高度一下
你就明白了
去掉背景和不去掉背景分别 运行一下
你就明白了
加background 是为了触发layout
把 #b的position 去掉,不加background mouseleave也是可以了,问题就出现在position:absolute;
ie6解析怪异,不像dom那样依旧认识#a下面#b的width及height
ie6只会认得内容来充满box,如下:
html code
nbsp;html public -/……
总算明白了害死人的ie6哦
加background 是为了触发layout
把 #b的position 去掉,不加background mouseleave也是可以了,问题就出现在position:absolute;
ie6解析怪异,不像dom那样依旧认识#a下面#b的width及height
ie6只会认得内容来充满box,如下:
html code
nbsp;html public……
++