-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
107 lines (106 loc) · 3.33 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!doctype html>
<html>
<head>
<script src="scrobMaster.js"></script>
<script>
scrob.register('bob2').addon({
'enter': function(scrollState){ this.elm.style.backgroundColor = (scrollState.direction == "up")? "red":"blue";},
'exit': function(scrollState){ this.elm.style.backgroundColor = "green";}
}).register('#nestedBob').on({
'enter': function(){
this.style.backgroundColor = "#FFF"
//console.log("in", this.absoluteTop);
},
'exit': function(){
this.style.backgroundColor = "#000"
//console.log("out", this.absoluteBottom);
}
}).addon('enter', function(state){this.style.border = "solid 2px yellow";});
scrob.register('.classBob').set({
'top': -200,
'bottom': -200,
'enter': function(state){this.style.backgroundColor = "gray";},
'exit': function(state){this.style.backgroundColor = "white";}
}).register('.classBob2').on({
'top': -200,
'bottom': -200,
'enter': function(state){this.style.backgroundColor = "red";},
'exit': function(state){this.style.backgroundColor = "white";}
});
</script>
<style>
.bob{
position: relative;
border: solid 1px blue;
height: 1200px;
margin: 100px;
padding: 100px;
}
#nestedBob{
position: absolute;
top: 200px;
left: 50%;
width: 200px;
margin-left: -100px;
border: solid 1px red;
height: 300px;
}
.classBob{
position: absolute;
height: 50px;
width: 50px;
border: solid 1px gray;
}
#classBob1{left: 20px;bottom: 20px;}
#classBob2{left: 90px;bottom: 60px;}
#classBob3{left: 160px;bottom: 100px;}
#classBob13{left: 230px;bottom: 140px;}
#classBob14{left: 300px;bottom: 180px;}
#classBob15{left: 370px;bottom: 220px;}
#classBob16{left: 440px;bottom: 260px;}
#classBob17{left: 510px;bottom: 300px;}
#classBob18{left: 580px;bottom: 340px;}
.classBob2{
position: absolute;
height: 50px;
width: 50px;
border: solid 1px gray;
}
#classBob4{right: 20px;bottom: 20px;}
#classBob5{right: 90px;bottom: 60px;}
#classBob6{right: 160px;bottom: 100px;}
#classBob7{right: 230px;bottom: 140px;}
#classBob8{right: 300px;bottom: 180px;}
#classBob9{right: 370px;bottom: 220px;}
#classBob10{right: 440px;bottom: 260px;}
#classBob11{right: 510px;bottom: 300px;}
#classBob12{right: 580px;bottom: 340px;}
</style>
</head>
<body>
<div class="bob" id="bob1">
<div class="classBob" id="classBob1"></div>
<div class="classBob" id="classBob2"></div>
<div class="classBob" id="classBob3"></div>
<div class="classBob" id="classBob13"></div>
<div class="classBob" id="classBob14"></div>
<div class="classBob" id="classBob15"></div>
<div class="classBob" id="classBob16"></div>
<div class="classBob" id="classBob17"></div>
<div class="classBob" id="classBob18"></div>
<div class="classBob2" id="classBob4"></div>
<div class="classBob2" id="classBob5"></div>
<div class="classBob2" id="classBob6"></div>
<div class="classBob2" id="classBob7"></div>
<div class="classBob2" id="classBob8"></div>
<div class="classBob2" id="classBob9"></div>
<div class="classBob2" id="classBob10"></div>
<div class="classBob2" id="classBob11"></div>
<div class="classBob2" id="classBob12"></div>
</div>
<div class="bob" id="bob2">
<div id="nestedBob"></div>
</div>
<div class="bob" id="bob3"></div>
</body>
</html>