Skip to content

Latest commit

 

History

History
executable file
·
53 lines (31 loc) · 1.33 KB

readme.md

File metadata and controls

executable file
·
53 lines (31 loc) · 1.33 KB

Backbone UI: Anchor

An extension to scroll with easing between link anchors

Ideally we would use CSS3 transitions but we're using requestAnimationFrame to clock the animations since scrollTop isn't considered a CSS attribute.

Dependencies

Examples

Install

Using bower:

bower install backbone.ui.anchor

Usage

Load the css and js in your app. Then load the view on the appropriate container:

var view = new Backbone.UI.Anchor({
text: "Check this out"
});

Options

position

Defaults to "bottom-right". Additional CSS classes have been set up to support "top-right", "top-left", "bottom-left", "left-middle" and "right-middle".

target

Defaults to top of page. Optionally set the id of the element on the page you want to scroll to.

Credits

Initiated by Lyndel Thomas ( @ryndel )

Distributed through Makesites.org

Released under the MIT license