想要的效果:最外层div鼠标进入后 div滑动 div中的按钮可以选择
现在鼠标经过按钮后 动画被重复激活 所以老在滑动 想把这个解决掉
希望大神们能指教
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="jquery-1.8.3.min.js"></script>
<script>
$(function(){
$(".d1").mouseover(function(){
$(this).animate({left:"5px"},300);
});
$(".d1").mouseout(function(){
$(this).animate({left:"0px"},300);
});
})
</script>
<style>
body {padding:0px;margin:0px;}
.d1 {width:70px;height:auto;background-color:#C90;position:absolute;left:0px;top:50px;padding:5px 5px 5px 5px;}
.d2 {
width:100%;
height:30px;
background-color:#FF6;
margin-bottom:5px;
display: block;
}
</style>
</head>
<body>
<div class="d1">
<a href="#" class="d2"></a>
<a href="#" class="d2"></a>
</div>
</body>
</html>
现在鼠标经过按钮后 动画被重复激活 所以老在滑动 想把这个解决掉
希望大神们能指教
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script src="jquery-1.8.3.min.js"></script>
<script>
$(function(){
$(".d1").mouseover(function(){
$(this).animate({left:"5px"},300);
});
$(".d1").mouseout(function(){
$(this).animate({left:"0px"},300);
});
})
</script>
<style>
body {padding:0px;margin:0px;}
.d1 {width:70px;height:auto;background-color:#C90;position:absolute;left:0px;top:50px;padding:5px 5px 5px 5px;}
.d2 {
width:100%;
height:30px;
background-color:#FF6;
margin-bottom:5px;
display: block;
}
</style>
</head>
<body>
<div class="d1">
<a href="#" class="d2"></a>
<a href="#" class="d2"></a>
</div>
</body>
</html>