Skip to content

Commit 12693c6

Browse files
author
frontid
authored
Add some documentation.
1 parent a63edcc commit 12693c6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
11
# jQueryIsInViewport
2+
3+
This plugin allows you to react when an element is in the viewport.
4+
You need throw confetti when the user scroll and see an element?, so this plugin is for you!
5+
6+
## Usage
7+
```javascript
8+
$('.block').isInViewport(function (status) {
9+
if (status === 'entered') {
10+
$(this).addClass('throw-confetti')
11+
}
12+
13+
if (status === 'leaved') {
14+
$(this).removeClass('throw-confetti')
15+
}
16+
})
17+
```
18+
19+
## Options
20+
Status can be '**entered**' or '**leaved**'.

0 commit comments

Comments
 (0)