From ec82b7639a7992c13f818ffad4815fd87a22ddd4 Mon Sep 17 00:00:00 2001 From: Vitor Buzinaro Date: Sun, 25 Feb 2018 13:23:15 -0300 Subject: [PATCH] docs(README): include module import description --- README.md | 22 +++++++++++++++++++--- package.json | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index de95404..496d56d 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,22 @@ If you want to make it works down to IE9, the only thing you need to do is to ad ``` -## RTL Support +## Usage -Add `direction: rtl;` to your `
`'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 `
` that you want to make scrollable, and the library will turn it for you @@ -67,5 +78,10 @@ document.body.appendChild(otherDiv); SimpleScrollbar.initAll(); ``` + +### RTL Support + +Add `direction: rtl;` to your `
`'s CSS, and SimpleScrollbar will detect the direction automatically. + ## Credits Inspired by yairEO's jQuery plugin ([fakescroll](https://github.com/yairEO/fakescroll)) diff --git a/package.json b/package.json index 205e47a..52d74f1 100644 --- a/package.json +++ b/package.json @@ -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": {