Skip to content

Commit b465934

Browse files
authored
Merge pull request #3 from phucbm/v2
update readme
2 parents 541e982 + 74485ba commit b465934

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
11
<div align="center">
22
<img width="100px" src="https://raw.githubusercontent.com/phucbm/scroll-direction/main/logo.svg" align="center" alt="Scroll Direction" />
33
<h1 align="center">Scroll Direction</h1>
4-
<p align="center">A lightweight jQuery plugin to detect scroll direction on your website. </p>
4+
<p align="center">A lightweight Javascript plugin to detect scroll direction on your website.</p>
55
</div>
66

77
<div align="center">
88
<a href="https://github.com/phucbm/https://badgen.net/github/release/phucbm/jquery-scroll-direction-plugin/?cache=600/releases/latest">
99
<img src="https://badgen.net/github/release/phucbm/jquery-scroll-direction-plugin/?cache=600/?cache=600">
1010
</a>
1111
<a href="https://www.jsdelivr.com/package/gh/phucbm/jquery-scroll-direction-plugin">
12-
<img src="https://data.jsdelivr.com/v1/package/gh/phucbm/jquery-scroll-direction-plugin/badge">
12+
<img src="https://data.jsdelivr.com/v1/package/gh/phucbm/jquery-scroll-direction-plugin/badge?style=rounded">
1313
</a>
14+
<span>
15+
<img src="https://raw.githubusercontent.com/webuild-community/badge/master/svg/made.svg" alt="made-in-vietnam">
16+
</span>
1417
</div>
1518

1619
> **Update**: Scroll Direction now works with other libraries that hijack the native scrollbar (like Locomotive Scroll).
1720
18-
**[View demo on CodePen &rarr;](https://codepen.io/phucbui/pen/yLaeqBw)**
19-
2021
## Getting started
2122

22-
### Download locally
23+
### Self-hosting
2324

2425
You
2526
can [download the plugin directly from Github](https://raw.githubusercontent.com/phucbm/jquery-scroll-direction-plugin/main/jquery.scroll-direction.js)
2627
.
2728

2829
```html
2930

30-
<script src="your-path/jquery.scroll-direction.js"></script>
31+
<script src="/jquery.scroll-direction.js"></script>
3132
```
3233

3334
### Using CDN
@@ -36,24 +37,27 @@ You can also browse for the latest version by
3637
visiting [Scroll Direction on jsDelivr](https://cdn.jsdelivr.net/gh/phucbm/jquery-scroll-direction-plugin/)
3738

3839
```html
39-
<!-- Scroll Direction - v1.1.0 -->
40-
<script src="https://cdn.jsdelivr.net/gh/phucbm/jquery-scroll-direction-plugin@1.1.0/jquery.scroll-direction.js"></script>
40+
<!-- Scroll Direction - v2.0.0 -->
41+
<script src="https://cdn.jsdelivr.net/gh/phucbm/jquery-scroll-direction-plugin@2.0.0/jquery.scroll-direction.js"></script>
4142
```
4243

4344
or minified version
4445

4546
```html
46-
<!-- Scroll Direction - v1.1.0 -->
47-
<script src="https://cdn.jsdelivr.net/gh/phucbm/jquery-scroll-direction-plugin@1.1.0/jquery.scroll-direction.min.js"></script>
47+
<!-- Scroll Direction - v2.0.0 -->
48+
<script src="https://cdn.jsdelivr.net/gh/phucbm/jquery-scroll-direction-plugin@2.0.0/jquery.scroll-direction.min.js"></script>
4849
```
4950

5051
### Initialize Scroll Direction
5152

5253
After init, you will have some classes on your body tag to indicate the scroll direction and position.
5354

5455
```js
55-
// init Scroll Direction
56+
// jQuery
5657
$.scrollDirection.init();
58+
59+
// Pure JS
60+
window.scrollDirection.init();
5761
```
5862

5963
```html
@@ -193,4 +197,4 @@ And start test server
193197

194198
```shell
195199
gulp serve
196-
```
200+
```

0 commit comments

Comments
 (0)