You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -111,14 +111,16 @@ options object as the second.
111
111
returnfalse;
112
112
});
113
113
```
114
+
114
115
* 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
116
117
position. If it's an options object, those options determine how the
117
118
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).
120
121
121
122
#### Additional Option
123
+
122
124
The following option, in addition to those listed for `$.fn.smoothScroll` above, is available
123
125
for `$.smoothScroll`:
124
126
@@ -131,6 +133,7 @@ for `$.smoothScroll`:
131
133
```
132
134
133
135
#### Note:
136
+
134
137
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.
135
138
136
139
### $.fn.scrollable
@@ -195,11 +198,13 @@ if (reSmooth.test(location.hash)) {
195
198
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.
196
199
197
200
* As of **smoothScroll version 2.2**, the plugin will automatically focus the element if you set the `autoFocus` option to `true`.
201
+
198
202
```js
199
203
$('div.example').smoothScroll({
200
204
autoFocus:true
201
205
});
202
206
```
207
+
203
208
* In the future, versions 3.x and later will have `autoFocus` set to true**by default**.
204
209
* If you are using the low-level `$.smoothScroll` method, `autoFocus` will only work if you've also provided a value for the `scrollTarget` option.
205
210
* 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