This addon provides has-scrolled
modifier which helps to understand whether the element was scrolled or not.
- Ember.js v3.20 or above
- Ember CLI v3.20 or above
- Node.js v12 or above
ember install ember-has-scrolled-modifier
has-scrolled
modifier accepts two positional arguments:
-
direction
: tracks scroll direction. Possible values are 'vertical', 'horizontal'. -
callback
: will be called when scroll event happened. An object will be passed as an argument with two boolean values:-
hasScrolled
: istrue
if the element was scrolled, isfalse
otherwise. -
hasRemainingScroll
: istrue
if the element has some scroll left, isfalse
otherwise.
-
Both values are false
when the element has no scroll.
PRs are welcome.
This project is licensed under the MIT License.