<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
.div1{
width: 100px;
height: 100px;
background-color: #7FFFD4;
position: absolute;
left: 40px;
top: 30px;
}
.div2{
width: 100px;
height: 100px;
background-color: deeppink;
position: absolute;
top: 30px;
left: 200px;
}
</style>
<script src="js/jq/jquery-2.1.3.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#btn").click(function(){
// delay()方法,一个参数,是时间,单位是毫秒,在动画的队列里面使用delay(800),起到延迟800毫秒,然后继续下一个动画动作
$(".div1").slideUp(300).delay(1000).fadeIn(800);
$(".div2").slideUp(300).fadeIn(500);
})
})
</script>
</head>
<body>
<input type="button" name="btn" id="btn" value="Run" />
<div class="div1"></div>
<div class="div2"></div>
</body>
</html>