Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ameesme committed Mar 16, 2016
1 parent 4c4b3d4 commit bd3a7ed
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# slimScroller.js
Smoothly scroll to positions on your website, under 350 bytes (gzipped) without dependencies (No jQuery).
Smoothly scroll to positions on your website, under 350 bytes, no dependencies.

## Two versions
### [SlimScroller Base](https://github.com/ameesme/SlimScroller.js/blob/master/dist/slimScroller.min.js)
Expand All @@ -12,26 +12,32 @@ The base version includes support for one type of scroll-target:
### [SlimScroller Full](https://github.com/ameesme/SlimScroller.js/blob/master/dist/slimScroller.full.min.js)
565 bytes gzipped
1010 bytes uncompressed
The full version includes support for four types of scroll-targets:
The full version includes support for three types of scroll-targets:
- Position in pixels ( eg. `slimScroller.scroll(200)` )
- CSS selector ( eg. `slimScroller.scroll("p:first-of-type")` )
- Direct JavaScript HTML-element ( eg. `slimScroller.scroll(document.querySelector(p#hi))` )

### Hashtags
By executing `slimScroller.bind()` when the dom finishes loading, SlimScroller will also animate same-page hashtag-scrolling in anchor tags.
### Hasthags
Want to bind SlimScroller to all anchor-tags on a page? Run `slimScroller.bind()` when the dom finishes loading. Only supported on [SlimScroller Full](https://github.com/ameesme/SlimScroller.js/blob/master/dist/slimScroller.full.min.js).

## How to scroll
## How to use
Just use the `slimScroller.scroll`-function with the following parameters.
- `Required` Scroll-target according to SlimScroller-version
- `Optional` Duration in `ms`
- `Optional` Switch to horizontal-scrolling in `boolean`
- `Optional` Callback-function with resulting scroll-position as parameter
- `Required` Scroll-target (according to SlimScroller-version)
- `Optional` Scroll-duration (`ms`)
- `Optional` Horizontal-scrolling instead of vertical (`boolean`)
- `Optional` Callback-function with final scroll-position as parameter

## Demo
Yes. It is hosted [here](https://amees.me/files/public/SlimScroller.js/demo.html).
[View here](https://amees.me/files/public/SlimScroller.js/demo.html).

## NPM
Yes. Use `npm install slimscroller`.
Run `npm install slimscroller`.

## Thanks
This is a smaller fork of [alicelieutier's smoothScroll](https://github.com/alicelieutier/smoothScroll).
##License (MIT)
Copyright © 2016 Mees Boeijen

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.

0 comments on commit bd3a7ed

Please sign in to comment.