Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cafe01/jquery-smooth-scroll

jQuery Smooth Scrolling Anchors Plugin
https://github.com/cafe01/jquery-smooth-scroll

Last synced: about 2 months ago
JSON representation

jQuery Smooth Scrolling Anchors Plugin

Awesome Lists containing this project

README

        

jquery-smooth-scroll
====================

jQuery Smooth Scrolling Anchors Plugin

# Usage

Using ``:

Scroll to foo smoothly.


...


$(function(){
$('a[href^=#']).smoothScroll({
// example using default options
duration: 600,
easing: 'swing'
});
})

Using any element:


Scroll to .foo smoothly.


...


$(function(){
$('h1').smoothScroll();
})

# Config Options

* duration - the scroll animation duration
* easing - the scroll animation easing

# Config Attributes

You can add config attributes to the clickable elements. (See demo.html)

* data-scroll-duration
* data-scroll-easing
* data-scroll-offset

# Todo

* change the browser fragment
* scroll when fragment changes
* scroll on init if fragment exists
* improve doc