forked from rwbaker/jQuery.fixed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·95 lines (77 loc) · 1.72 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fixed Div on Scroll</title>
<style type="text/css">
/* Spacing */
body {margin:20px;}
hr {margin:10px 0;}
#top {height:300px; margin-bottom:20px;}
#container {min-width:600px;}
/* Boxes */
.content {border:1px solid #ccc; background:#eee;}
#sidebar-inner {border:1px solid #aaa; background:#ccc;}
.content,
#sidebar-inner {padding:10px;}
/* Grid & Spacing */
#wrapper {float:left; width:100%;}
#wrapper-inner {margin-right: 320px;}
#wrapper .content {min-height:200px; }
#sidebar {float:right; width:300px; margin-left:-320px; position:relative;}
#sidebar-inner {min-height:500px;}
/* Sidebar positioning */
/* .absolute {position:absolute; width:280px;}
.fixed {position:fixed; width:280px; top:20px;}
*/
#sidebar-inner {width:280px;}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="js/jquery.fixed.js"></script>
<script>
$(document).ready(function(){
$('#sidebar-inner').fixed({
top: 20
});
});
</script>
</head>
<body>
<div id="container">
<div id="top" class="content">
</div>
<div id="wrapper">
<div id="wrapper-inner">
<div class="content">
.content
</div>
<hr>
<div class="content">
.content
</div>
<hr>
<div class="content">
.content
</div>
<hr>
<div class="content">
.content
</div>
<hr>
<div class="content">
.content
</div>
<hr>
<div class="content">
.content
</div>
</div>
</div>
<div id="sidebar">
<div id="sidebar-inner">
.sidebar
</div>
</div>
</div>
</body>
</html>