-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Azin Asili
committed
Apr 17, 2017
1 parent
7ae4b65
commit bd23fc5
Showing
1 changed file
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,63 @@ | ||
# dragit | ||
Click/tab and drag to scroll content within a container. | ||
# Dragit | ||
Click/tap and drag to scroll content within a container. Apply Dragit to a single container or every container on your page. Dragit is a small and simple plugin to use however you need. | ||
|
||
[DEMO](https://codepen.io/azinasili/pen/bWdXGr?editors=1010) | ||
|
||
## Installation | ||
With [NPM](https://www.npmjs.com/package/dragit): | ||
|
||
```bash | ||
npm install dragit --save | ||
``` | ||
|
||
With [Bower](https://bower.io/): | ||
|
||
```bash | ||
bower install dragit --save | ||
``` | ||
|
||
Or include Dragit directly: | ||
|
||
```html | ||
<script src="/path/to/dragit.js"></script> | ||
``` | ||
|
||
Dragit is written using [ES2015 modules](http://2ality.com/2014/09/es6-modules-final.html). To import Dragit into an ES2015 application: | ||
|
||
```javascript | ||
import Dragit from 'dragit'; | ||
``` | ||
|
||
|
||
## Usage | ||
Dragit only requires the container element to be smaller than it's contents. | ||
|
||
```html | ||
<div id="dragme"> | ||
... | ||
</div> | ||
``` | ||
|
||
```css | ||
#dragme { | ||
height: 100px; | ||
overflow: auto; | ||
width: 100px; | ||
} | ||
``` | ||
|
||
```javascript | ||
const dragme = new Dragit('#dragme'); | ||
``` | ||
|
||
|
||
### Methods | ||
#### destroy() | ||
**Usage:** Kills the instance of Dragit. | ||
|
||
#### init() | ||
**Usage:** Creates new instance of Dragit. | ||
|
||
|
||
## License | ||
MIT License |