Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 jquery.sap.js
Octocat-spinner-32 jquery.sap.min.js
README.md

jQuery Sap

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.

Requirements

  1. jQuery

Usage

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
});

Demo

View Demo Here View Other Demo

Known Issues

  • Sap does not work on iOS.
  • Sap does not always reset default CSS properly.

License

Licensed under the MIT License.

Something went wrong with that request. Please try again.