This plugin will start sliding a content of a block element when the browser window top will reach the element top position.
This plugin requires the following library to work:
https://github.com/cowboy/jquery-throttle-debounce/
Use the plugin as follows:
$('#sidebar-menu').stickyScroller({
stopAtElement: $('.footer'),
parentContainer: $('div.sidebar'),
contentWrapper: $('div.content')
});Make sure to include the CSS styles in your stylesheet
You have to pass the jQuery element that the slider will stop at when sliding down
Parent container that holds your slider element
Content wrapper that wraps the slider and other content around, needs to have position: relative
The plugin will use two extra classes stuck and stuck-bottom which will change the position of the scrollable element
.stuck {
position: fixed;
top:0px;
}
.stuck-bottom {
position:absolute;
bottom:0px;
}You can always modify those classes to your liking
- Requires jQuery 1.6+.
- Works in all A-grade browsers, including IE6.
This plugin is dual licensed under the MIT and GPL licenses.
Submit a bug report above or here: