App下载
实例代码( Tip: 登录后体验更佳 )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<head>
<script src="//libs.baidu.com/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$(".btn1").click(function(){
$("#p1").animate({height:"+=20px"});
});
$(".btn2").click(function(){
$("#p1").animate({height:"-=20px"});
});
});
</script>
</head>
<body>
<button class="btn1">Animate +</button>
<button class="btn2">Animate -</button>
<p>This is a paragraph.</p>
<p id="p1" style="border:1px solid blue;">This is an animated paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
运行结果