Skip to content

individual11/Scroll-To

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

#Scroll To an easy way to scroll to an anchor

See it in action.


##Installation You can install Scroll-To through bower by running the following command in terminal.

$ bower install Scroll-To

##HTML setup

You don't have to change how you setup your HTML at all. Simply set the href the same way you normally would. This means everything will still work even if JavaScript is disabled in the browser.

<a href="#anchorPoint" id="selectorID">Click Here</a>

##JQuery

The JQuery code is pretty straight forward as well.

$('#selectorID').scrollTo();

##Optional Parameters

  • offset - this allows you to offset the stop position plus or minus in pixels. The default is 0.
  • speed - controls the speed of the scrolling, and supports any viable Jquery animation speed (i.e. 'fast' or 5000). The default is 'slow'.
  • override - this will allow you to override the default anchor scroll to position. The default is null.
  • easing - if you include JQuery UI, you can use their easing equations like the following block of code.
$('#selector').scrollTo({
	easing: 'easeOutBounce'
});

###License

MIT http://rem.mit-license.org

About

JQuery plugin to make animated scrolling easy to setup and use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published