Skip to content

Commit

Permalink
readme updated for micro
Browse files Browse the repository at this point in the history
  • Loading branch information
asvd committed Mar 24, 2015
1 parent 3da97b2 commit 958634b
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dragscroll
==========

Dragscroll is a tiny javascript library (978 bytes minified) which
Dragscroll is a tiny javascript library (425 bytes minified) which
enables scrolling via holding the mouse button (drag-n-drop style,
[online demo](http://asvd.github.io/dragscroll/)).

Expand All @@ -10,10 +10,8 @@ enables scrolling via holding the mouse button (drag-n-drop style,


Download the
[distribution](https://github.com/asvd/dragscroll/releases/download/v0.0.1/dragscroll-0.0.1.tar.gz),
unpack it and load the `dragscroll.js` in a preferrable way. That is
an UMD module, thus for instance it may simply be loaded as a plain
JavaScript file using the `<script>` tag:
[distribution](https://github.com/asvd/dragscroll/releases/download/v0.0.2/dragscroll-0.0.2.tar.gz),
unpack it and load the `dragscroll.js` or `dragscroll_micro.js`:

```html
<script src="dragscroll.js"></script>
Expand All @@ -34,6 +32,22 @@ Keep in mind that now it is not possible to select the content with
mouse, so apply the `cursor: default;` CSS style to prevent confusing
the users (or even `cursor: grab;` in case the content is not a text).

If you add (or remove) the `dragscroll` class after the page was
loaded, invoke `dragscroll.reset()` to update the listeners.

### Micro verison

Located in `dragscroll_micro.js`, its size is 425 bytes, and it just works.


### Full-featured verison

Located in `dragscroll.js`, has some additional features:

- that is an UMD module, so you can load it in a preferrable way;

- it can be loaded after the page load, the library will find the elements with the `dragscroll` class and setup the events for them (micro version does this on page load and should be included in the `<head>`);

- add or remove the `dragscroll` class dynamically (if you do it,
invoke `dragscroll.reset()` to update the listeners).


Have fun!

0 comments on commit 958634b

Please sign in to comment.