v0.1.0
A jQuery plugin to hide a top header bar as you scroll down, reveal it as you scroll back up, and fix it to the top of the window when visible. It is heavily inspired by (and even uses code from) eduardomb's scroll-up-bar.
The biggest differences between this plugin and scroll-up-bar is that it supports a bottom offset, doesn't initiate on iOS (too many issues), and adds a few extra options.
Create a top bar/header element that is absolutely positioned, then invoke the plugin on it with:
$('#header').revealbar(options);
Reveal Bar uses some of the same options as scroll-up-bar, and adds some new ones.
-
Function
onDetach
Called when the element is detached from the top (its initial state).
-
Function
onAttach
Called when the element is attached to the top (its initial state).
-
Function
onShow
Called when the element becomes visible when scrolling.
-
Function
onHide
Called when the element becomes hidden when scrolling.
-
Number
bottomOffset
The amount in pixels that the element should be offset on the bottom when scrolling.
-
$.revealbar.destroy
Resets element to its original position, disables the plugin, and calls
options.onAttach
.