Skip to content

Commit 958634b

Browse files
committed
readme updated for micro
1 parent 3da97b2 commit 958634b

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dragscroll
22
==========
33

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

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

1111

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

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

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

36+
### Micro verison
37+
38+
Located in `dragscroll_micro.js`, its size is 425 bytes, and it just works.
39+
40+
41+
### Full-featured verison
42+
43+
Located in `dragscroll.js`, has some additional features:
44+
45+
- that is an UMD module, so you can load it in a preferrable way;
46+
47+
- 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>`);
48+
49+
- add or remove the `dragscroll` class dynamically (if you do it,
50+
invoke `dragscroll.reset()` to update the listeners).
51+
52+
53+
Have fun!

0 commit comments

Comments
 (0)