Skip to content

Commit 6921aa0

Browse files
committed
Update readme with setup using CDN and grabbing standard or minified versions
1 parent e8f8ab9 commit 6921aa0

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

readme.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,41 @@ Allows for easy implementation of smooth scrolling for same-page links.
66

77
Note: Version 2.0+ of this plugin requires jQuery version 1.7 or greater.
88

9-
## Download
9+
## Setup
1010

11-
Using npm:
11+
### ES Module
1212

1313
```bash
1414
npm install jquery-smooth-scroll
1515
```
1616

17-
The old-fashioned way:
17+
or
1818

19-
Go to the following URL in your browser and copy/paste the code into your own file:
20-
https://raw.githubusercontent.com/kswedberg/jquery-smooth-scroll/master/jquery.smooth-scroll.min.js
19+
```bash
20+
yarn add jquery-smooth-scroll
21+
```
22+
23+
Then, use `import jquery-smooth-scroll`;
24+
25+
**Note**: This assumes `window.jQuery` is available at time of import.
26+
27+
### CDN
28+
29+
```html
30+
<!--
31+
You can get a URL for jQuery from
32+
https://code.jquery.com
33+
-->
34+
<script src="SOME_URL_FOR_JQUERY"></script>
35+
<script src="https://cdn.statically.io/gh/kswedberg/jquery-smooth-scroll/3948290d/jquery.smooth-scroll.min.js"></script>
36+
```
37+
38+
### Copy/paste
39+
40+
Grab the code and paste it into your own file:
41+
42+
* [Standard version](https://raw.githubusercontent.com/kswedberg/jquery-smooth-scroll/master/jquery.smooth-scroll.js)
43+
* [Minified version](https://raw.githubusercontent.com/kswedberg/jquery-smooth-scroll/master/jquery.smooth-scroll.js)
2144

2245
## Demo
2346

0 commit comments

Comments
 (0)