Lightweight jQuery Scroll To HTML Elements Plugin - Arbitrary Anchor

Lightweight jQuery Scroll To HTML Elements Plugin - Arbitrary Anchor
File Size: 8.95 KB
Views Total: 3197
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Arbitrary Anchor is a lightweight and fast jQuery plugin that allows you to create anchor links to scroll to any html elements with smooth & configurable scrolling effects.

Basic Usage:

1. Include the latest jQuery library and arbitrary-anchor.js script on the web page

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.arbitrary-anchor.js"></script>

2. Create an anchor link. Scrolled to in 100ms (default is 750ms)

<li> <a href="#scrollto|500">#scrollto</a> </li>

3. Create an html element where you want to scroll to

<h2 id="scrollto">I have an id "scrollto"</h2>

4. Create an html element where you want to scroll to

<h2 id="scrollto">I have an id "scrollto"</h2>

5. Parameters.

AA_CONFIG = {
  animationLength:  750,
  easingFunction:   'linear',
  scrollOffset:     0
};

Change log:

2015-04-28

  • Update jquery.arbitrary-anchor.js

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