-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
88 lines (87 loc) · 1.56 KB
/
index.html
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example jQuery.isViewPort</title>
<style>
.area {
height: 400px;
background: #CCC;
padding: 10px;
margin: 10px;
}
.change {
width: 100px;
height: 100px;
box-shadow: 3px 4px 2px #111010;
background: #c50955;
margin: 0 auto;
position: relative;
top: 40%;
text-align: center;
}
.change.on {
-webkit-animation: .5s visible infinite alternate ease-in-out;
-moz-animation: .5s visible infinite alternate ease-in-out;
animation: .5s visible infinite alternate ease-in-out;
}
.change span {
font-size: 20px;
font-family: monospace;
position: relative;
top: 34px;
}
@keyframes visible{
0% {
margin-top: 0;
}
100% {
margin-top: 50px;
}
}
@-webkit-keyframes visible{
0% {
margin-top: 0;
}
100% {
margin-top: 50px;
}
}
@-moz-keyframes visible{
0% {
margin-top: 0;
}
100% {
margin-top: 50px;
}
}
</style>
</head>
<body>
<section class="area">
<div class="change"></div>
</section>
<section class="area">
<div class="change"></div>
</section>
<section class="area">
<div class="change"></div>
</section>
<section class="area">
<div class="change"></div>
</section>
<script src="libs/jquery.min.js"></script>
<script src="source/jquery.isviewport.min.js"></script>
<script>
jQuery('.area').isViewPort({
visible : function(rect) {
rect.context
.find('.change')
.html('<span>show</span>')
.addClass('on')
;
}
});
</script>
</body>
</html>