Skip to content

attitude/scrollTriggers.js

Repository files navigation

scrollTriggers.js

Minimalistic scrolling vanilla JS plugin, zero dependency < 2KB minified.

See demo

Options

  • el - Element or string (element id)
  • before, during, after - [object Function] callback
  • originfloat from 0 to 1, default: 0.5, where 0 = top of the screen, 1 = bottom of the screen

Usage

Link the script file and initialize the elements to watch;

window.addScrollingTriggers([{
    el: 'section-with-some-specific-id',
    before: function() {
        App.api.navigationVisible(true);
    },
    during: function () {
        App.api.navigationVisible(true);
    },
    after: function () {
        App.api.navigationVisible(false);
    },
    origin: 1
}]);

About

Works with modern browsers, pull requests are welcome.

About

Minimalistic scrolling vanilla JS plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •