Skip to content

Commit

Permalink
✨ 📝 Add data-cartapus-root-margin option, update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Striffly committed Jan 10, 2023
1 parent eacd3ad commit 3e48f22
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 14 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,13 @@ Some additional attributes are available to allow both of those cases, overridin
<div class="box"
data-cartapus
data-cartapus-threshold="0.5"
data-cartapus-root-margin="0px 0px -200px 0px"
data-cartapus-once="true">
</div>
```

- `data-cartapus-threshold` : overrides the `threshold` option. *Ie : this element will be visible when 50% of its height is visible.*
- `data-cartapus-root-margin` : overrides the `rootMargin` option. *Ie : the bottom bounding box of this element will be shrunk of 200px.*
- `data-cartapus-once` : overrides the `once` option. *Ie : this element will switch to `visible`, then never switch back to `hidden` again.*

## Methods
Expand Down
2 changes: 1 addition & 1 deletion build/cartapus.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3e48f22

Please sign in to comment.