forked from dirkgroenen/viewport-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (49 loc) · 1.57 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
<!-- Demo page -->
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.js"></script>
<script src="viewportchecker.js"></script>
<style>
body,html{
width: 100%;
height: 100%;
margin: 0;
font-family: 'Helvetica';
padding: 0;
}
.dummy{
width: 100%;
height: 40%;
font-size: 0px;
-webkit-transition: all .3s;
transition: all .3s;
-moz-transition: all .3s;
text-align: center;
}
.dummy.visible{
font-size: 50px;
color: white;
text-shadow: 0 0 3px black;
}
</style>
<script>
$(document).ready(function(){
// Create dummy data
for(var i = 0; i < 20; i++){
$('body').append("<div class='dummy' style='background-color: rgb("+ Math.floor(Math.random()*10)+1 +","+ Math.floor(Math.random()*10)+1 +","+ Math.floor(Math.random()*00)+1 +")'>visible</div>");
}
$('.dummy').viewportChecker({
offset: 200,
callbackFunction: function(elem){
setTimeout(function(){
elem.html('Changed by callback');
},500);
}
});
});
</script>
</head>
<body>
</body>
</html>