-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathmultiple-items.html
More file actions
112 lines (102 loc) · 2.46 KB
/
multiple-items.html
File metadata and controls
112 lines (102 loc) · 2.46 KB
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
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta charset="UTF-8" />
<title>Sticksy.js - Multiple items</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Inconsolata, 'Helvetica', sans-serif;
/* fix freezing issue in iframes */
-webkit-backface-visibility: hidden;
}
h1,
h2,
h3 {
text-align: center;
}
.wrapper {
display: flex;
justify-content: center;
max-width: 700px;
margin: 0 auto;
}
.container {
min-height: 50rem;
flex: 1;
margin: 0.3rem;
border: 1px solid grey;
}
.filler {
display: flex;
justify-content: center;
align-items: center;
font-size: 2rem;
margin: 10px;
height: 95vh;
color: #d2d2d2;
border: 2px dashed #ffc4c4;
}
.block {
display: flex;
justify-content: center;
align-items: center;
font-size: 2rem;
height: 8rem;
margin: 10px;
border: 2px dotted #afafaf;
}
.block.js-sticky-widget {
background: #f0f0f0;
}
.block.is-big {
height: 10rem;
}
.block.is-small {
height: 6rem;
}
</style>
</head>
<body>
<h1>Move down ↓</h1>
<hr />
<div class="wrapper">
<div id="container1" class="container">
<div class="block"></div>
<div class="block js-sticky-widget">😎</div>
<div class="block"></div>
</div>
<div id="container2" class="container">
<div class="block is-big"></div>
<div class="block is-small"></div>
<div class="block js-sticky-widget">😎</div>
</div>
<div id="container3" class="container">
<div class="block js-sticky-widget">😎</div>
<div class="block"></div>
<div class="block"></div>
</div>
<div id="container4" class="container">
<div class="block"></div>
<div class="block is-big js-sticky-widget">😎</div>
<div class="block"></div>
</div>
</div>
<div class="filler">VERY BIG BLOCK</div>
<script src="../src/sticksy.js"></script>
<script>
Sticksy.initializeAll('.js-sticky-widget', { listen: true })
// ... the same as
// new Sticksy('#container1 .block.js-sticky-widget')
// new Sticksy('#container2 .block.js-sticky-widget')
// new Sticksy('#container3 .block.js-sticky-widget')
// new Sticksy('#container4 .block.js-sticky-widget')
</script>
</body>
</html>