Simple jQuery Plugin For Smooth Anchor Scrolling - Butter Scroll

Simple jQuery Plugin For Smooth Anchor Scrolling - Butter Scroll
File Size: 5.84 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Butter Scroll is a lightweight jQuery plugin which enables anchor links to scroll smoothly to specific points of your webpage. With a optional back to top button which allows you to scroll back to the top of the webpage.

How to use it:

1. Create anchor links that point to specific id within the document.

<a href="#article-1">Article 1</a>

<article id="article-1">
  ...
</article>

2. Include jQuery library and the jQuery butter scroll plugin on the webpage.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="js/jq-butterscroll-0.0.1.js"></script>

3. Call the plugin on the anchor links and done.

$('a').butterScroll();

4. Change the scroll speed.

$('a').butterScroll({
  speed: 500,
});

5. Generate a 'back to top' button.

$('a').butterScroll({
  toplink: true, 
  container: 'body' // Where do you want the toplink to go?
});

This awesome jQuery plugin is developed by antisilent. For more Advanced Usages, please check the demo page or visit the official website.