Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md « jquery.scrollTo « bower_components « libs - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 844314ca0a3711d661daef63624b4b5781d187f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# jQuery.ScrollTo

### Installation and usage

Using [bower](https://github.com/twitter/bower):
```bash
bower install jquery.scrollTo
```
Using npm:
```bash
npm install jquery.scrollto
```
Using [composer](http://getcomposer.org/download/):

Either run

```
php composer.phar require --prefer-dist flesler/jquery.scrollto "*"
```

or add

```
"flesler/jquery.scrollto": "*"
```

to the require section of your composer.json.

### Downloading Manually

If you want the latest stable version, get the latest release from the [releases page](https://github.com/flesler/jquery.scrollTo/releases).

### Notes

* Apart from the target and duration, the plugin can receive a hash of settings. Documentation and examples are included in the source file.

* If you are interested in animated "same-page-scrolling" using anchors(href="#some_id"), check http://github.com/flesler/jquery.localScroll

* For a slideshow-like behavior using scrolling, check http://github.com/flesler/jquery.serialScroll

* The target can be specified as:
  * A Number/String specifying a position using px or just the number.
  * A string selector that will be relative, to the element that is going to be scrolled, and must match at least one child.
  * A DOM element, logically child of the element to scroll.
  * A hash { top:x, left:y }, x and y can be any kind of number/string like described above.

* The plugin supports relative animations

* 'em' and '%' are not supported as part of the target, because they won't work with jQuery.fn.animate.
  
* 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.

* Both axes ( x, y -> left, top ) can be scrolled, you can send 'x', 'y', 'xy' or 'yx' as 'axis' inside the settings.

* 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)

* The option 'margin' can be set to true, then the margin of the target element, will be taken into account and will be deducted.

* 'margin' will only be valid, if the target is a selector, a DOM element, or a jQuery Object.

* 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), { top:x, left:y } or a function that returns an object with top & left.

* 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}

* Don't forget the callback event is now called 'onAfter', and if queuing is activated, then 'onAfterFirst' can be used.

* If the first axis to be scrolled, is already positioned, that animation will be skipped, to avoid a delay in the animation.

* 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'.

* If you find any bug, or you have any advice, don't hesitate to open an issue.