Skip to content

zaneray/scrolltoid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

$.scrollToID()

Smooth Scrolling to an ID on the page.

scrollToID is a jQuery plugin that attaches to an anchor link. Just make the anchor reference an id with the # tag. It nicely falls back to standard anchor links and accepts an offset and speed argument.

Example

It's so easy:

HTML

<a href="#infobox" class="js-scrolltoid">Click Me</a>

Javascript

$('.js-scrolltoid').scrollToID({
  speed: 1000, //expressed in Milliseconds
  offset: 30   //in pixels
});

About

Scroll To ID - Smooth scrolling to IDs on a page

Resources

License

Stars

Watchers

Forks

Packages

No packages published