-
Notifications
You must be signed in to change notification settings - Fork 57
/
dev1.html
97 lines (75 loc) · 2.83 KB
/
dev1.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
<!DOCTYPE html>
<html>
<head>
<title>fixto, a jQuery plugin for sticky positioning</title>
<style>
.box {
height:300px; width:300px; background: red;
}
.child{
height:50px;width:50px;background:yellow;
}
#list li{
margin-bottom:20px;
}
#pinky {
padding:10px;
}
</style>
</head>
<body style="">
<div style="background:pink;clear:both" id="pinky">
#pinky
</div>
<div id="left" style="margin-left:30px;float:left">
<div style="width:300px;height:300px;background:black"></div>
<div id="father" class="box">
<div id="child" class="child">#child</div>
</div>
<div style="width:300px;height:300px;background:black"></div>
</div>
<div style="float:left">
<ul id="list">
<li class="box"><div class="child"></div></li>
<li class="box"><div style="width:70px;height:70px;background:gray"></div><div class="child"></div><div style="width:70px;height:70px;background:gray"></div></li>
<li class="box"><div class="child"></div></li>
</ul>
</div>
<div style="float:left;position:relative;top:200px">
<ul id="list2">
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
<li class="box"><div class="child"></div></li>
</ul>
</div>
<div id="blue" style="width:200px;height:200px;background:blue;float:right;"></div>
<div style="clear:both"></div>
<script src="libs/jquery/jquery.js" type="text/javascript" charset="utf-8"></script>
<script src="src/fixto.js" type="text/javascript" charset="utf-8"></script>
<script>
$('#pinky').fixTo('body', {zIndex:10})
$('#child').fixTo('#father', {mind:'#pinky'});
$('#list .child').fixTo('#list>li', {mind:'#pinky'});
$('#list2 .child').fixTo('#list2>li', {mind:'#pinky'});
$('#blue').fixTo('body', {mind:'#pinky'});
</script>
</body>
</html>