Skip to content

Commit db2c761

Browse files
authored
Merge pull request #18 from busybox11/patch-1
Improve README and fixed a typo
2 parents ba160b7 + d0bcce9 commit db2c761

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

README.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Include MenuSpy
1616

1717
`MenuSpy` will be available in the global scope.
1818

19-
Or install via NPM/Yarn and require as a module
19+
You can also use NPM / Yarn to install it and then require it as a module.
2020

2121
NPM
2222

@@ -30,11 +30,15 @@ Yarn
3030
yarn add menuspy
3131
```
3232

33+
Require the module:
34+
3335
```js
3436
var MenuSpy = require('menuspy');
3537
```
3638

37-
Initialize the plugin on your menu element
39+
---
40+
41+
Example of menu element:
3842

3943
```html
4044
<header id="main-header">
@@ -55,6 +59,8 @@ You can also use `data-target` on the anchor element with a selector. Example:
5559
<a href="#anything" data-target="selector">Anything</a>
5660
```
5761

62+
Initialize the plugin on your menu element.
63+
5864
```js
5965
var elm = document.querySelector('#main-header');
6066
var ms = new MenuSpy(elm);
@@ -65,11 +71,11 @@ The `MenuSpy()` constructor accepts two arguments: the container element and an
6571

6672
## Options
6773

68-
| Option | Type | Default | Description |
69-
| ---------------------| -------- | -------------------------- | ------------------------------------------------------------------------ |
70-
| `menuItemSelector` | String | `a[href^="#"]` | Menu items selector. |
71-
| `activeClass` | String | `active` | Class applied on menu item relative to the currently visible section. |
72-
| `threshold` | Integer | `15` | Ammount of space between your menu and the next section to be activated. |
73-
| `enableLocationHash` | Boolean | `true` | Enable or disable browser's hash location change. |
74-
| `hashTimeout` | Integer | `600` | Timeout to apply browser's hash location. |
75-
| `callback` | Function | `function(currentItem) {}` | A function to be called every time a new menu item activates. |
74+
| Option | Type | Default | Description |
75+
| ---------------------| -------- | -------------------------- | ----------------------------------------------------------------------- |
76+
| `menuItemSelector` | String | `a[href^="#"]` | Menu items selector. |
77+
| `activeClass` | String | `active` | Class applied on menu item relative to the currently visible section. |
78+
| `threshold` | Integer | `15` | Amount of space between your menu and the next section to be activated. |
79+
| `enableLocationHash` | Boolean | `true` | Enable or disable browser's hash location change. |
80+
| `hashTimeout` | Integer | `600` | Timeout to apply browser's hash location. |
81+
| `callback` | Function | `function(currentItem) {}` | A function to be called every time a new menu item activates. |

0 commit comments

Comments
 (0)