(问题解决了,谁接个分结贴了)Jquery 二级导航 focusout ie和其他浏览器不同的 问题

mrsupersky 2011-06-28 09:35:09
下面是我写的而二级导航条,问题是在IE(IE9)中显示没有任何问题,在Opera,Chrome中focusout 事件无效(没有反映)
为什么,请教高人!!!

CSS代码:

.menu div div div
{
width: 1024px;
clear: both;
margin-left: 0px;
}
.item, .item div a
{
text-align: center;
width: 100px;
border-style: solid;
text-decoration: none;
color: #000;
border-color: #000;
border-width: 1px;
float: left;
margin: 0px;
display: inline;
height: 26px;
line-height: 26px;
font-size: 18px;
background-color: #ffa;
}
.item div a:hover,.itemfocused
{
height: 32px;
line-height: 32px;
font-size: 26px;
background-color: #aaf;
}
.item:hover
{
background-color: #aaf;
}

.menu
{
height: 32px;
}
.menu div
{
float: left;
width: 100px;
}

Jquery代码:

$(
function () {
var childmousenter = false;
$(".item").each(function (i) {

$(":first-child", this).hide();

$(this).bind("click", function () {
if ($(":first-child", this).css("display") == "none") {
$(":first-child", this).show();
$(this).addClass(".itemfocused");
}
else {
$(":first-child", this).hide();
$(this).removeClass(".itemfocused");
}
});

$(this).bind("focusout",function () { $(":first-child", this).hide(200); });
$(":first-child", this).bind("focusout", function () { $(":first-child", this).hide(); });
var lenght = $("a", $(":first-child", this)).length * 102;
$("div", this).width(lenght);

});
});

Html代码:

<div class="menu">
<div>
<div class="item" style="clear: both;">
111<div style="background: #000;width:400px;">
<a href="http://localhost/8080" target="_blank">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a>
</div>
</div>
</div>
<div>
<div class="item" style="clear: both;">
111
<div style="background: #000;">
<a href="http://localhost/8080" target="_blank">1</a> <a href="#">2</a> <a href="#">3</a> <a href="#">4</a>
</div>
</div>
</div>
...全文
146 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
maggieyanghy 2011-06-30
  • 打赏
  • 举报
回复
呵呵。。。我来接。
mrsupersky 2011-06-30
  • 打赏
  • 举报
回复
谁接一下分啊,不多就20。。。
接了马上就结贴了
JSPerl 2011-06-30
  • 打赏
  • 举报
回复
还有这好事?我来
ma1986 2011-06-30
  • 打赏
  • 举报
回复
我来了,接起
aperson111 2011-06-30
  • 打赏
  • 举报
回复
接分~
mrsupersky 2011-06-29
  • 打赏
  • 举报
回复
算了,自己解决了,求人不如求己。。。

87,989

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧