jquery中animate()动画方法

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="jquery-2.1.1.min.js" ></script>
<style>
#div1{width:100px;height:100px;background:red;}
#div2{width:100px;height:100px;background:red;margin-top:10px;}
</style>
<script>
$(function(){
$('#div1').mouseover(function(){

$(this).animate({width:300,height:300},4000,'linear',function(){
alert(123);

});
$('#div2').animate({width:300,height:300},4000,'swing');
});

});

</script>
</head>
<body>
<div id="div1"></div>
<div id="div2"></div>
</body>
</html>

posted @ 2016-03-09 09:46  天--安静  阅读(194)  评论(0编辑  收藏  举报