大伙我有一个弹出层:
HTML:<div id="add" >
<a herf="">123</a>
<br/>456789
</div>
jquery: var objStr = "#add";
$(objStr).mouseover(function() { $(objStr).show()});
$(objStr).mouseout(function() { $(objStr).hide(); });
我移动到a标记的时候层就被hide了,怎么解决这个问题呢
而这样却不会!是怎么回事
#UpLayer span{border:#fff 1px solid; width:80px; padding:0 5px; line-height:20px; display:block;}
#UpLayer ul{display:none;position:absolute;border:#ccc 1px solid;width:80px; padding:5px; line-height:20px; background:#f1f1f1; margin:-1px 0 0 0;}
#UpLayer ul li{ border-bottom:#ccc 1px dashed;}
</style>
</head>
<body>
<script type="text/javascript">
// 弹出层
$(document).ready(function(){
var objStr = "#UpLayer";
$(objStr).mouseover(function(){$(objStr + " ul").show();});
$(objStr).mouseout(function(){$(objStr + " ul").hide();});
});
</script>
<!-- 弹出层 -->
<div id="UpLayer">
<span><a>弹出层</a></span>
<ul >
<li><a href="#">手机资讯</a></li>
<a href="#">手机资讯</a>
<li><a href="#">热门文章</a></li>
<li><a href="#">联系站长</a></li>
<li><a href="#">建议意见</a></li>
</ul>
</div>