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
Copy file name to clipboardExpand all lines: README.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ This defines the position to where `element` must be scrolled. The plugin suppor
62
62
### _settings_
63
63
64
64
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:
66
66
*__axis__: The axes to animate: `xy` (default), `x`, `y`, `yx`
67
67
*__interrupt__: If `true` will cancel the animation if the user scrolls. Default is `false`
68
68
*__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
82
82
*__progress()__: A callback triggered on every frame
83
83
* And more, check jQuery's [documentation](http://api.jquery.com/animate/#animate-properties-options)
84
84
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
+
85
95
### Stopping the animation
86
96
87
97
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