jQuery滑动动画

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jQuery滑动动画</title>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js "></script>
<script>

$(function () {

$("#btn1").click(function () {

$("#box").slideDown("fast");
}); $("#btn2").click(function () {

$("#box").slideUp("slow");
});

$("#btn3").click(function () {

$("#box").slideToggle("slow");
});

















})
</script>
<style>
#box{
height: 600px;
width: 400px;
border: 1px solid black;
background-color: lightpink;
margin-bottom: 20px;
display: none;
}

button{

margin-left: 20px;
}
</style>
</head>
<body>

<div id="box">
</div>
<button id="btn1">slideDown</button>
<button id="btn2">slideUp</button>
<button id="btn3">slideToggle</button>


</body>
</html>
posted @ 2017-05-11 20:40  YoogaChan  阅读(257)  评论(0编辑  收藏  举报