Skip to content

Commit d7df558

Browse files
committed
Lint readme.md and add .nvmrc
1 parent 965affd commit d7df558

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6

readme.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ options object as the second.
9898
### $.smoothScroll
9999

100100
* Utility method works without a selector: `$.smoothScroll()`
101-
* Can be used to scroll any element (not just `document.documentElement` /
102-
`document.body`)
101+
* Can be used to scroll any element (not just `document.documentElement` / `document.body`)
103102
* Doesn't automatically fire, so you need to bind it to some other user
104103
interaction. For example:
104+
105105
```js
106106
$('button.scrollsomething').on('click', function() {
107107
$.smoothScroll({
@@ -111,14 +111,16 @@ options object as the second.
111111
return false;
112112
});
113113
```
114+
114115
* The `$.smoothScroll` method can take one or two arguments.
115-
* If the first argument is a number or a "relative string," the document is scrolled to that
116+
* If the first argument is a number or a "relative string," the document is scrolled to that
116117
position. If it's an options object, those options determine how the
117118
document (or other element) will be scrolled.
118-
* If a number or "relative string" is provided as the second argument, it will override whatever may have been set for the `scrollTarget` option.
119-
* The relative string syntax, introduced in version 2.1, looks like `"+=100px"` or `"-=50px"` (see below for an example).
119+
* If a number or "relative string" is provided as the second argument, it will override whatever may have been set for the `scrollTarget` option.
120+
* The relative string syntax, introduced in version 2.1, looks like `"+=100px"` or `"-=50px"` (see below for an example).
120121

121122
#### Additional Option
123+
122124
The following option, in addition to those listed for `$.fn.smoothScroll` above, is available
123125
for `$.smoothScroll`:
124126

@@ -131,6 +133,7 @@ for `$.smoothScroll`:
131133
```
132134

133135
#### Note:
136+
134137
If you use `$.smoothScroll`, do NOT use the `body` element (`document.body` or `$('body')`) alone for the `scrollElement` option. Probably not a good idea to use `document.documentElement` (`$('html')`) by itself either.
135138

136139
### $.fn.scrollable
@@ -195,11 +198,13 @@ if (reSmooth.test(location.hash)) {
195198
Imagine you have a link to a form somewhere on the same page. When the user clicks the link, you want the user to be able to begin interacting with that form.
196199

197200
* As of **smoothScroll version 2.2**, the plugin will automatically focus the element if you set the `autoFocus` option to `true`.
201+
198202
```js
199203
$('div.example').smoothScroll({
200204
autoFocus: true
201205
});
202206
```
207+
203208
* In the future, versions 3.x and later will have `autoFocus` set to true **by default**.
204209
* If you are using the low-level `$.smoothScroll` method, `autoFocus` will only work if you've also provided a value for the `scrollTarget` option.
205210
* Prior to version 2.2, you can use the `afterScroll` callback function. Here is an example that focuses the first input within the form after scrolling to the form:

0 commit comments

Comments
 (0)