$('#id').animate(css,time,callback);
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<style type="text/css">
#box {
width: 300px;
height: 300px;
background:greenyellow;
}
</style>
</head>
<body>
<div id='box'></div>
</body>
<script>
</script>
</html>
$('#box').on('mouseover',function(){
alert();
});
$('#box').on('mouseover',function(){
$('#box').animate({width:600},500);
});
$('#box').on('mouseover',function(){
$('#box').animate({width:600},500,function(){
$('#box').animate({height:600},500);
});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script type="text/javascript" src="jquery-1.11.2.min.js"></script>
<style type="text/css">
body {
background: url(background1.jpg) no-repeat;
position: fixed;
}
ul li {
list-style: none;
}
.wrap {
position: relative;
left: 170px;
top: 65px;
}
.plants1 {
display: inline-block;
position: relative;
left:35px;
}
.plants1 .plant {
position: relative;
margin-bottom:20px;
}
.plants1 .plant .PB00 {
position: absolute;
top:-2px;
left:15px;
}
.plants2 {
display: inline-block;
position: relative;
left:2px;
}
.plants2 .plant {
position: relative;
margin-bottom:20px;
}
.plants2 .plant .PB00 {
position: absolute;
top:-2px;
left:15px;
}
.plants3 {
display: inline-block;
position: relative;
left:-40px;
}
.plants3 .plant {
position: relative;
margin-bottom:20px;
}
.plants3 .plant .PB00 {
position: absolute;
top:-2px;
left:15px;
}
</style>
</head>
<body>
<div class='wrap'>
<ul class='plants1'>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
</ul>
<ul class='plants2'>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
</ul>
<ul class='plants3'>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
<li class='plant'>
<img class='Peashooter' src="img/Peashooter.gif" />
<img class='PB00' src="img/PB00.gif" />
</li>
</ul>
</div>
</body>
<script type="text/javascript">
function randomNum(num){
return Math.floor(Math.random()*(num+1));
};
setInterval(function(){
var $this = $('.PB00').eq(randomNum(17));
$this.animate({'margin-left' : 1000},2000,function(){
$this.css({'margin-left' : 0});
});
},10);
</script>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有