Skip to content

Commit 66c7a3c

Browse files
committed
Documented changing default settings
1 parent 15bfa73 commit 66c7a3c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This defines the position to where `element` must be scrolled. The plugin suppor
6262
### _settings_
6363

6464
The `duration` parameter is a shortcut to the setting with the same name.
65-
These are the list of supported settings:
65+
These are the supported settings:
6666
* __axis__: The axes to animate: `xy` (default), `x`, `y`, `yx`
6767
* __interrupt__: If `true` will cancel the animation if the user scrolls. Default is `false`
6868
* __limit__: If `true` the plugin will not scroll beyond the container's size. Default is `true`
@@ -82,6 +82,16 @@ You can add any setting supported by [$().animate()](http://api.jquery.com/anima
8282
* __progress()__: A callback triggered on every frame
8383
* And more, check jQuery's [documentation](http://api.jquery.com/animate/#animate-properties-options)
8484

85+
### Changing the default settings
86+
87+
As with most plugins, the default settings are exposed so they can be changed.
88+
```js
89+
$.extend($.scrollTo.defaults, {
90+
axis: 'y',
91+
duration: 800
92+
});
93+
```
94+
8595
### Stopping the animation
8696

8797
jQuery.scrollTo ends up creating ordinary animations which can be stopped by calling [$().stop()](http://api.jquery.com/stop/) or [$().finish()](http://api.jquery.com/finish/) on the same element you called `$().scrollTo()`, including the `window`.

0 commit comments

Comments
 (0)