Skip to content

Commit e29c1ff

Browse files
committed
add readme
1 parent fff1fb3 commit e29c1ff

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
Make items sticky as you scroll, to a point.
2+
3+
## Usage
4+
5+
<pre>&lt;div class="container">
6+
&lt;div class="row stickem-container">
7+
&lt;div class="content">
8+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
9+
&lt;/div>
10+
11+
&lt;div class="aside stickem">
12+
I'm gonna be sticky!
13+
&lt;/div>
14+
&lt;/div>
15+
&lt;/div></pre>
16+
17+
<pre>.stickem-container {
18+
position: relative;
19+
}
20+
21+
.stickit {
22+
margin-left: 660px;
23+
position: fixed;
24+
top: 0;
25+
}
26+
27+
.stickit-end {
28+
bottom: 40px;
29+
position: absolute;
30+
right: 0;
31+
}</pre>
32+
33+
<pre>$('.container').stickem();</pre>
34+
35+
### Defaults
36+
37+
*item: '.stickem'*
38+
Items that you want to stick on scroll.
39+
40+
*container: '.stickem-container'*
41+
Container that you want the sticky item to be contained in.
42+
43+
*stickClass: 'stickit'*
44+
Class added to the sticky item once it should start being sticky.
45+
46+
*endStickClass: 'stickit-end'*
47+
Class added to the sticky item once it has reached the end of the container
48+
49+
*offset: 0*
50+
Do you already have a fixed horizontal header on the page? Offset stick 'em by that many pixels.
51+
52+
*start: 0*
53+
If your sticky item isn't at the top of the container, tell it where it should start being sticky.

0 commit comments

Comments
 (0)