jquery中animate()动画方法
Posted 天--安静
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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>
以上是关于jquery中animate()动画方法的主要内容,如果未能解决你的问题,请参考以下文章