Skip to content

Releases: Twikito/onscroll-effect

Better class feature, and better API

06 Oct 16:32
Compare
Choose a tag to compare
  • 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 class is-outside will be used by default.

  • Better API: now you can test if an element is isInsideViewport, isRepeating or get repeatingCount.
    Go check the API section in the documentation.

New `reverse` option

13 Feb 14:33
fe0d15c
Compare
Choose a tag to compare

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

12 Oct 12:59
Compare
Choose a tag to compare

No arguments.callee for strict mode.

Initial version!

30 Aug 18:24
Compare
Choose a tag to compare

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.