ScrollDir, short for Scroll Direction, is a 0 dependency, ~1kb micro Javascript plugin to easily leverage vertical scroll direction in CSS via a data attribute.

ScrollDir is perfect for:

– Showing or hiding sticky elements based on scroll direction.
– Only changing its direction attribute when scrolled a significant amount.
– Ignoring small scroll movements that cause unwanted jitters.

[gpp_button color=”blue” url=”http://codepen.io/yowainwright/pen/9d5a6c6dcf2c17e351dcccfe98158e8b” title=”vertical css” icon_left=”external” target=”_blank” size=”medium” display=”inline”]Demo[/gpp_button]    [gpp_button color=”blue” url=”https://dollarshaveclub.github.io/scrolldir/” title=”vertical css” icon_left=”cloud-download” target=”_blank” size=”medium” display=”inline”]ScrollDir[/gpp_button]