Skip to content

A JS/JQuery lib that snaps content to elements as you scroll.

License

Notifications You must be signed in to change notification settings

BrianRollins/snap-points

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snap-Points.js
Copyright 2016 by Brian Rollins (me at brianrollins.com)
Requires JQuery (jquery.com)

Just add the attribute data-snap="true" to the elements you want the browser to snap to.
You can adjust the scroll speed (scrollSpeed) in your code or override it here.

If you don't feel like coding it into the HTML, use the snapAll() function and
pass a string (or array of strings) in for the element(s) you want affected.

Ex: snapAll("p") will add the data-snap="true" attribute to all <p> tags.
Ex: snapAll(["h1", "h2", "h3", "h4", "h5", "h6"]) gets all the various header tags.

About

A JS/JQuery lib that snaps content to elements as you scroll.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published