jquery鼠标经过弹出层写法
<div class="navitem"><a href="/index.php?c=news&a=index&id=52">新闻中心</a>
<div class="navitemlist" style="display: none;">
<a href="/index.php?c=news&a=index&id=52">公司新闻</a>
<a href="/index.php?c=news&a=index&id=53">媒体报道</a>
</div>
</div>
$(".navitem").hover(function(){
$(this).children('a').next('.navitemlist').fadeIn();
},function(){
$(this).children('a').next('.navitemlist').css('display','none');
});
.header .navitem {
height: 100%;
padding-left: 20px;
padding-right: 20px;
display: block;
line-height: 102px;
font-size: 16px;
color: #242169;
border-bottom: 1px #FFF solid;
text-decoration: none;
float: left;
position: relative;
}
.navitemlist {
height: auto;
overflow: hidden;
position: absolute;
left: 0px;
top: 75px;
background: #FFF;
z-index: 9999;
text-align: left;
display: none;
}
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/18834.html