| 1 | jQuery.ScrollTo 1.3
|
|---|
| 2 |
|
|---|
| 3 | * Apart from the target and duration, the plugin can receive a hash of settings. Documentation and examples are included in the source file.
|
|---|
| 4 |
|
|---|
| 5 | * If you are interested in animated "same-page-scrolling" using anchors(<a href="#some_id">...), check http://jquery.com/plugins/project/LocalScroll
|
|---|
| 6 |
|
|---|
| 7 | * The plugin no longer depends on Dimensions.
|
|---|
| 8 |
|
|---|
| 9 | * The target can be specified as:
|
|---|
| 10 | * A Number/String specifying a position using px or just the number.
|
|---|
| 11 | * A string selector that will be relative, to the element that is going to be scrolled, and must match at least one child.
|
|---|
| 12 | * A DOM element, logically child of the element to scroll.
|
|---|
| 13 | * A hash { top:x, left:y }, x and y can be any kind of number/string like described above.
|
|---|
| 14 |
|
|---|
| 15 | * Appart from $().scrollTo(), the plugin includes $.scrollTo() to scroll the whole screen. They accept the same parameters.
|
|---|
| 16 |
|
|---|
| 17 | * The plugin supports relative animations
|
|---|
| 18 |
|
|---|
| 19 | * 'em' and '%' are not supported as part of the target, because they won't work with jQuery.fn.animate.
|
|---|
| 20 |
|
|---|
| 21 | * The plugin might fail to scroll an element, to an inner node that is nested in more scrollable elements. This seems like an odd situation anyway.
|
|---|
| 22 |
|
|---|
| 23 | * Both axes ( x, y -> left, top ) can be scrolled, you can send 'x', 'y', 'xy' or 'yx' as 'axis' inside the settings.
|
|---|
| 24 |
|
|---|
| 25 | * If 2 axis are scrolled, there's an option to queue the animations, so that the second will start once the first ended ('xy' and 'yx' will have different effects)
|
|---|
| 26 |
|
|---|
| 27 | * The option 'margin' can be setted to true, then the margin of the target element, will be taken into account and will be deducted.
|
|---|
| 28 |
|
|---|
| 29 | * 'margin' will only be valid, if the target is a selector, a DOM element, or a jQuery Object.
|
|---|
| 30 |
|
|---|
| 31 | * The option 'offset' allows to scroll less or more than the actual target by a defined amount of pixels. Can be a number(both axes) or { top:x, left:y }.
|
|---|
| 32 |
|
|---|
| 33 | * The option 'over' lets you add or deduct a fraction of the element's height and width from the final position. so over:0.5 will scroll to the middle of the object. can be specified with {top:x, left:y}
|
|---|
| 34 |
|
|---|
| 35 | * Don't forget the callback event is now called 'onAfter', and if queuing is activated, then 'onAfterFirst' can be used.
|
|---|
| 36 |
|
|---|
| 37 | * If the first axis to be scrolled, is already positioned, that animation will be skipped, to avoid a delay in the animation.
|
|---|
| 38 |
|
|---|
| 39 | * The call to the plugin can be made in 2 different ways: $().scrollTo( target, duration, settings ) or $().scrollTo( target, settings ). Where one of the settings is 'duration'.
|
|---|
| 40 |
|
|---|
| 41 | * If you find any bug, or you have any advice, don't hesitate to open a ticket/request at http://jquery.com/plugins/project/ScrollTo . |
|---|