Skip to content

Commit

Permalink
docs(README): include module import description
Browse files Browse the repository at this point in the history
  • Loading branch information
buzinas committed Feb 25, 2018
1 parent 7dff9d3 commit ec82b76
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ If you want to make it works down to IE9, the only thing you need to do is to ad
<!--[if IE 9]><script src="classList.min.js"></script><![endif]-->
```

## RTL Support
## Usage

Add `direction: rtl;` to your `<div>`'s CSS, and SimpleScrollbar will detect the direction automatically.
You can use this library as a script tag, or you can import it as a npm module, eg:

### CommonJS

```js
const SimpleScrollbar = require('simple-scrollbar');
```

### ES2015 modules

```js
import SimpleScrollbar from 'simple-scrollbar'
```

## Usage
### Auto-binding
Include the attribute `ss-container` in any `<div>` that you want to make scrollable, and the library will turn it for you

Expand Down Expand Up @@ -67,5 +78,10 @@ document.body.appendChild(otherDiv);
SimpleScrollbar.initAll();
```


### RTL Support

Add `direction: rtl;` to your `<div>`'s CSS, and SimpleScrollbar will detect the direction automatically.

## Credits
Inspired by yairEO's jQuery plugin ([fakescroll](https://github.com/yairEO/fakescroll))
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-scrollbar",
"version": "0.3.1",
"version": "0.4.0",
"description": "Very simple vanilla javascript library for creating a custom scrollbar cross-browser and cross-devices.",
"main": "simple-scrollbar.js",
"repository": {
Expand Down

0 comments on commit ec82b76

Please sign in to comment.