-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimateTest1.html
More file actions
39 lines (38 loc) · 794 Bytes
/
AnimateTest1.html
File metadata and controls
39 lines (38 loc) · 794 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>AnimateTest</title>
<style type="text/css">
.more {
position: absolute;
--必須有position屬性才能移動
}
.moveIt {
position: relative;
border: 1px solid #333;
cursor: pointer;
}
</style>
<script src="jquery-3.2.1.min.js"></script>
<script>
$(document).ready(function() {
$('p').animate({
left: '200px',
fontSize: '20px',
opacity: .5
}, 2000);
$('div').click(function() {
$(this).animate({
left: '+=50px'
}, 1000);
});
});
</script>
</head>
<body>
<div class="moveIt">Click me</div>
<p>jQuery is a JavaScript function library.</p>
<p class="more">jQuery was invented in 2006 by John Resig at BarCamp.</p>
</body>
</html>