首页 > 代码库 > 同步动画

同步动画

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
<style type="text/css">
div{
height:20px;
border:1px solid red;
}
</style>
<script src="http://www.mamicode.com/js/jQuery1.11.1.js"></script>
<script src="http://www.mamicode.com/js/jquery-migrate-1.2.0.js"></script>
<script type="text/javascript">

$(function() {
$("[type=button]").bind("click", function() {
//队列:
$("div")
.animate({"font-Size":"50px"},2000,function(){alert(‘aa‘);})//css属性、时长、完成后的执行的函数
.animate({"width":"200px"},{ queue: false, duration: 2000 });//不再同一队列(类似开了个线程),持续两秒
});
});
</script>
</head>
<body>
<div>我是div</div>
<input type="button" value="http://www.mamicode.com/样式"/>
</body>
</html>

同步动画