jquery中,mouseover为什么不停的淡入淡出
<linkhref="css/style.css"type="text/css"rel="stylesheet"><scriptsrc="js/jquery-1.8.3....
<link href="css/style.css" type="text/css" rel="stylesheet">
<script src="js/jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="header">
<div class="header_l">
<a href="#"><img src="images/logo.png" alt="企业LOGO" /></a>
<span class="font_yahei">山东XX网络科技有限公司</span>
<div class="header_nav">
<ul id="nav_conente">
<li class="nav_1">
<a href="#" class="nav_1_a font_yahei">公司首页</a>
<ul class="nav_2">
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
</ul>
</li>
<li class="nav_1">
<a href="#" class="nav_1_a font_yahei">公司首页</a>
<ul class="nav_2">
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<script>
$(document).ready(function(){
var nav=$("#nav_conente").children();
//alert(nav.length);
for(var i=0;i<nav.length;i++){
nav.eq(i).on("mouseover",function(){
var $this = $(this);
$this.children(".nav_2").fadeIn(500);
});
nav.eq(i).on("mouseout",function(){
var $this = $(this);
$this.children(".nav_2").fadeOut(500);
});
}
});
</script> 展开
<script src="js/jquery-1.8.3.min.js"></script>
</head>
<body>
<div class="header">
<div class="header_l">
<a href="#"><img src="images/logo.png" alt="企业LOGO" /></a>
<span class="font_yahei">山东XX网络科技有限公司</span>
<div class="header_nav">
<ul id="nav_conente">
<li class="nav_1">
<a href="#" class="nav_1_a font_yahei">公司首页</a>
<ul class="nav_2">
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
</ul>
</li>
<li class="nav_1">
<a href="#" class="nav_1_a font_yahei">公司首页</a>
<ul class="nav_2">
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
<li><a href="#" class="font_st nav_2_a">阿萨德</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<script>
$(document).ready(function(){
var nav=$("#nav_conente").children();
//alert(nav.length);
for(var i=0;i<nav.length;i++){
nav.eq(i).on("mouseover",function(){
var $this = $(this);
$this.children(".nav_2").fadeIn(500);
});
nav.eq(i).on("mouseout",function(){
var $this = $(this);
$this.children(".nav_2").fadeOut(500);
});
}
});
</script> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询