Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/posabsolute/jquery-scrollbar-slider
Better html anchor, a jquery script to slide the scrollbar
https://github.com/posabsolute/jquery-scrollbar-slider
Last synced: 25 days ago
JSON representation
Better html anchor, a jquery script to slide the scrollbar
- Host: GitHub
- URL: https://github.com/posabsolute/jquery-scrollbar-slider
- Owner: posabsolute
- License: mit
- Created: 2012-10-18T01:36:02.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-10-14T12:41:14.000Z (about 10 years ago)
- Last Synced: 2024-04-15T03:01:03.244Z (7 months ago)
- Language: JavaScript
- Size: 167 KB
- Stars: 27
- Watchers: 6
- Forks: 19
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# jQuery Scrollbar Slider
HTML anchor links can be a useful tool to link to a location in a very long page. However, the default implementation
of HTML anchor links are not intuitive. When a user clicks on a link, they expect to go to another page. Instead, an
clicking on an HTML anchor link makes a jarring jump down the page.This jQuery plugin eases the pain of that interaction by smoothly scrolling down the page to reach the anchor
destination.## Installation via Bower
```
bower install --save jquery-scrollbar-slider
```## Options
Name | Type | Default | Description
------------- | ---- | ------- | -----------
speed | int | 1100 | How fast in milliseconds to scroll down to the anchor
offset | int | 0 | Setting this to a non-zero value will adjust where the scrolling will stop relative to the actual anchor position. It has the side effect of not placing the `#id` into the URL due to standard browser behavior forcing the page to always be at the anchor location defined by the hash in the URL.## Sample Use
You can see full HTML examples in action in the `examples` folder of this project. The basic approach is to
### Basic
```
Click Me!
Much content might be between me and the anchor...
$(document).ready(function() {
$("a.anchorLink").anchorAnimate();
});
```
### Overriding the Defaults
```
Click Me!
Much content might be between me and the anchor...
/** Do not have to wrap these in document.ready() */
$.fn.anchorAnimate.defaults.speed = 50;
$.fn.anchorAnimate.defaults.offset = 50;$(document).ready(function() {
$("a.anchorLink").anchorAnimate();
});
```
## Licence
The plugin is licensed under the [MIT license](http://opensource.org/licenses/mit-license.php):
```
Copyright (c) 2012 Cedric Dugas, http://www.position-absolute.com/
```