Sap is a jQuery plugin that makes the elements of your choosing sticky (see what we did there?) when scrolling. By default, your elements will stick to the top of the viewport, but this behavior may be changed by setting the distanceFromTheTop
option.
- jQuery
You can apply Sap to any element in the DOM by simply calling $(selector).sap()
$('#item').sap();
You can also specify the distance from the top of the viewport that you want Sap to activate
$('#item').sap({
distanceFromTheTop: 0
});
View Demo Here View Other Demo
Licensed under the MIT License.