Minimalistic scrolling vanilla JS plugin, zero dependency < 2KB minified.
el
-Element
orstring
(element id)before
,during
,after
-[object Function]
callbackorigin
–float
from0
to1
, default:0.5
, where 0 = top of the screen, 1 = bottom of the screen
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
}]);
Works with modern browsers, pull requests are welcome.