Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Ferdinandi committed May 18, 2015
1 parent 2c367e3 commit c943ca1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 36 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# The MIT License (MIT)

Copyright (c) Go Make Things, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
62 changes: 26 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ A lightweight script to animate scrolling to anchor links. Smooth Scroll works g
4. [Options & Settings](#options-and-settings)
5. [Browser Compatibility](#browser-compatibility)
6. [Known Issues](#known-issues)
7. [Contributors](#contributors)
8. [How to Contribute](#how-to-contribute)
9. [License](#license)
10. [Older Docs](#older-docs)
7. [How to Contribute](#how-to-contribute)
8. [License](#license)



Expand Down Expand Up @@ -145,11 +143,11 @@ Smooth Scroll also lets you override global settings on a link-by-link basis usi
```html
<a data-scroll
data-options='{
"speed": 500,
"easing": "easeInOutCubic",
"offset": 0,
"updateURL": false
}'
"speed": 500,
"easing": "easeInOutCubic",
"offset": 0,
"updateURL": false
}'
>
Anchor Link
</a>
Expand Down Expand Up @@ -204,6 +202,24 @@ Add a `[data-scroll-header]` data attribute to fixed headers. Smooth Scroll will
</nav>
```

### Animating links to other pages

Smooth Scroll does not include an option to animate scrolling to links on other pages, but you can easily add this functionality using the API.

1. Do *not* add the `data-scroll` attribute to links to other pages. Treat them like normal links, and include your anchor link hash as normal.
```markup
<a href="some-page.html#example">
```
2. Add the following script to the footer of your page, after the `smoothScroll.init()` function.
```markup
<script>
if ( window.location.hash ) {
var options = {}; // Any custom options you want to use would go here
smoothScroll.animateScroll( null, window.location.hash, options );
}
</script>
```


## Browser Compatibility

Expand All @@ -219,38 +235,12 @@ If the `<body>` element has been assigned a height of `100%`, Smooth Scroll is u



## Contributors

* Easing support contributed by [Willem Liu](https://github.com/willemliu).
* Easing functions forked from [Gaëtan Renaudeau](https://gist.github.com/gre/1650294).
* URL history support contributed by [Robert Pate](https://github.com/robertpateii).
* Fixed header support contributed by [Arndt von Lucadou](https://github.com/a-v-l).
* Infinite loop bugs in iOS and Chrome (when zoomed) by [Alex Guzman](https://github.com/alexguzman).
* IE10 rounding error fixed by [Luke Siedle](https://github.com/luke-siedle).
* Enhanced callback functions by [Constant Meiring](https://github.com/constantm).
* Scroll-to-top bug for links at the bottom of the page by [Jonas Havers](https://github.com/JonasHavers).
* AMD support and numerous code improvements by [Todd Motto](https://github.com/toddmotto).
* Push State bug fix by [Yanick Witschi](https://github.com/Toflar).
* CommonJS module support by [Riku Rouvila](https://github.com/rikukissa).
* Query string fix when updating URL by [Qu Yatong](https://github.com/quyatong).
* Scroll to top support by [Robbert Broersma](https://github.com/robbert).
* Unit tests by [Thibaud Colas](https://github.com/ThibWeb).
* Browserify support by [Alexander Beletsky](https://github.com/alexbeletsky).



## How to Contribute

In lieu of a formal style guide, take care to maintain the existing coding style. Don't forget to update the version number, the changelog (in the `readme.md` file), and when applicable, the documentation.



## License
Smooth Scroll is licensed under the [MIT License](http://gomakethings.com/mit/).



## Older Docs

* [Version 3](http://cferdinandi.github.io/smooth-scroll/archive/v3/)
* [Version 1](https://github.com/cferdinandi/smooth-scroll/tree/archive-v1)
The code is available under the [MIT License](LICENSE.md).

0 comments on commit c943ca1

Please sign in to comment.