Releases: Twikito/onscroll-effect
Better class feature, and better API
-
In respond of request #19, now you can fill the
data-scroll
attributes with as many classes as you need, so it's compatible with any CSS framework.
If you leave it empty, the classis-outside
will be used by default. -
Better API: now you can test if an element is
isInsideViewport
,isRepeating
or getrepeatingCount
.
Go check the API section in the documentation.
New `reverse` option
The default behaviour of this library is adding a class when the element is outside of the viewport, but sometimes, you may need the opposite behaviour, i.e. adding a class when the element is inside the viewport.
So here is a new attribute data-scroll-reverse
: Instead of adding the class when the element is outside of the viewport, reverse this behaviour and add the class when the element is inside the viewport, is-inside
class name as default if data-scroll
is empty.
In this case, you will probably need to add the class to your element as default in your code to avoid JavaScript dependency.
Thanks @CFT-Chris for the pull request 👍
Fix for strict mode
No arguments.callee for strict mode.
Initial version!
Features:
- A class to be added when element goes outside of viewport,
is-outside
if empty - Infinite repeating, several times or once
- An offset to be taken into account fromtop and bottom edges of the viewport
- Custom prefix for html attributes
- Asynchronous initialization
- Hooks enable
- State properties
and documentation.