Skip to content

Commit f627415

Browse files
committed
Tweaks for #90
1 parent 0be4aaa commit f627415

File tree

7 files changed

+125
-116
lines changed

7 files changed

+125
-116
lines changed

README.md

Lines changed: 71 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,71 @@
1-
# jQuery.ScrollTo
2-
3-
### Installation and usage
4-
5-
Using [bower](https://github.com/twitter/bower):
6-
```bash
7-
bower install jquery.scrollTo
8-
```
9-
Using [composer](http://getcomposer.org/download/):
10-
11-
Either run
12-
13-
```
14-
php composer.phar require --prefer-dist flesler/jquery.scrollto "*"
15-
```
16-
17-
or add
18-
19-
```
20-
"flesler/jquery.scrollto": "*"
21-
```
22-
23-
to the require section of your composer.json.
24-
25-
### Downloading Manually
26-
27-
If you want the latest stable version, get the latest release from the [releases page](https://github.com/flesler/jquery.scrollTo/releases).
28-
29-
### Notes
30-
31-
* Apart from the target and duration, the plugin can receive a hash of settings. Documentation and examples are included in the source file.
32-
33-
* If you are interested in animated "same-page-scrolling" using anchors(href="#some_id"), check http://github.com/flesler/jquery.localScroll
34-
35-
* For a slideshow-like behavior using scrolling, check http://github.com/flesler/jquery.serialScroll
36-
37-
* The target can be specified as:
38-
* A Number/String specifying a position using px or just the number.
39-
* A string selector that will be relative, to the element that is going to be scrolled, and must match at least one child.
40-
* A DOM element, logically child of the element to scroll.
41-
* A hash { top:x, left:y }, x and y can be any kind of number/string like described above.
42-
43-
* The plugin supports relative animations
44-
45-
* 'em' and '%' are not supported as part of the target, because they won't work with jQuery.fn.animate.
46-
47-
* 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.
48-
49-
* Both axes ( x, y -> left, top ) can be scrolled, you can send 'x', 'y', 'xy' or 'yx' as 'axis' inside the settings.
50-
51-
* 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)
52-
53-
* The option 'margin' can be set to true, then the margin of the target element, will be taken into account and will be deducted.
54-
55-
* 'margin' will only be valid, if the target is a selector, a DOM element, or a jQuery Object.
56-
57-
* 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.
58-
59-
* 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}
60-
61-
* Don't forget the callback event is now called 'onAfter', and if queuing is activated, then 'onAfterFirst' can be used.
62-
63-
* If the first axis to be scrolled, is already positioned, that animation will be skipped, to avoid a delay in the animation.
64-
65-
* 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'.
66-
67-
* If you find any bug, or you have any advice, don't hesitate to open an issue.
1+
# jQuery.ScrollTo
2+
3+
### Installation and usage
4+
5+
Using [bower](https://github.com/twitter/bower):
6+
```bash
7+
bower install jquery.scrollTo
8+
```
9+
Using npm:
10+
```bash
11+
npm install jquery.scrollto
12+
```
13+
Using [composer](http://getcomposer.org/download/):
14+
15+
Either run
16+
17+
```
18+
php composer.phar require --prefer-dist flesler/jquery.scrollto "*"
19+
```
20+
21+
or add
22+
23+
```
24+
"flesler/jquery.scrollto": "*"
25+
```
26+
27+
to the require section of your composer.json.
28+
29+
### Downloading Manually
30+
31+
If you want the latest stable version, get the latest release from the [releases page](https://github.com/flesler/jquery.scrollTo/releases).
32+
33+
### Notes
34+
35+
* Apart from the target and duration, the plugin can receive a hash of settings. Documentation and examples are included in the source file.
36+
37+
* If you are interested in animated "same-page-scrolling" using anchors(href="#some_id"), check http://github.com/flesler/jquery.localScroll
38+
39+
* For a slideshow-like behavior using scrolling, check http://github.com/flesler/jquery.serialScroll
40+
41+
* The target can be specified as:
42+
* A Number/String specifying a position using px or just the number.
43+
* A string selector that will be relative, to the element that is going to be scrolled, and must match at least one child.
44+
* A DOM element, logically child of the element to scroll.
45+
* A hash { top:x, left:y }, x and y can be any kind of number/string like described above.
46+
47+
* The plugin supports relative animations
48+
49+
* 'em' and '%' are not supported as part of the target, because they won't work with jQuery.fn.animate.
50+
51+
* 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.
52+
53+
* Both axes ( x, y -> left, top ) can be scrolled, you can send 'x', 'y', 'xy' or 'yx' as 'axis' inside the settings.
54+
55+
* 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)
56+
57+
* The option 'margin' can be set to true, then the margin of the target element, will be taken into account and will be deducted.
58+
59+
* 'margin' will only be valid, if the target is a selector, a DOM element, or a jQuery Object.
60+
61+
* 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.
62+
63+
* 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}
64+
65+
* Don't forget the callback event is now called 'onAfter', and if queuing is activated, then 'onAfterFirst' can be used.
66+
67+
* If the first axis to be scrolled, is already positioned, that animation will be skipped, to avoid a delay in the animation.
68+
69+
* 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'.
70+
71+
* If you find any bug, or you have any advice, don't hesitate to open an issue.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jquery.scrollTo",
3-
"version": "1.4.12",
3+
"version": "1.4.13",
44
"description": "Easy element scrolling using jQuery.",
55
"homepage": "https://github.com/flesler/jquery.scrollTo",
66
"main": [

changes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.4.13
2+
[Misc]
3+
- Support for CommonJS / NPM added by durango
4+
15
1.4.12
26
[Fix]
37
- Fixed selector matching body fails on window scrolling

jquery.scrollTo.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/*!
2-
* jQuery.ScrollTo
2+
* jQuery.scrollTo
33
* Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
44
* Licensed under MIT
55
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
66
* @projectDescription Easy element scrolling using jQuery.
77
* @author Ariel Flesler
8-
* @version 1.4.15
8+
* @version 1.4.13
99
*/
10-
1110
;(function (define) {
1211
'use strict';
1312

1413
define(['jquery'], function ($) {
14+
1515
var $scrollTo = $.scrollTo = function( target, duration, settings ) {
1616
return $(window).scrollTo( target, duration, settings );
1717
};
@@ -172,15 +172,16 @@
172172

173173
function both( val ) {
174174
return $.isFunction(val) || typeof val == 'object' ? val : { top:val, left:val };
175-
};
175+
}
176176

177-
// AMD requirement
178-
return $scrollTo;
179-
})
177+
// AMD requirement
178+
return $scrollTo;
179+
})
180180
}(typeof define === 'function' && define.amd ? define : function (deps, factory) {
181-
if (typeof module !== 'undefined' && module.exports) { //Node
182-
module.exports = factory(require('jquery'));
183-
} else {
184-
window.jQuery.fn.scrollTo = factory(window['jQuery']);
185-
}
181+
if (typeof module !== 'undefined' && module.exports) {
182+
// Node
183+
module.exports = factory(require('jquery'));
184+
} else {
185+
factory(jQuery);
186+
}
186187
}));

jquery.scrollTo.min.js

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "jquery-scrollto",
2+
"name": "jquery.scrollto",
33
"version": "1.4.13",
44
"description": "Easy element scrolling using jQuery.",
55
"homepage": "https://github.com/flesler/jquery.scrollTo",

scrollTo.jquery.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
{
2-
"name": "scrollTo",
3-
"title": "Ariel Flesler's jQuery scrollTo",
4-
"description": "Easy element scrolling using jQuery.",
5-
"keywords": ["browser", "animated", "animation", "scrolling", "scroll", "links", "anchors"],
6-
"version": "1.4.12",
7-
"author": {
8-
"name": "Ariel Flesler",
9-
"email": "[email protected]",
10-
"url": "http://flesler.blogspot.com"
11-
},
12-
"maintainers": [{
13-
"name": "Ariel Flesler",
14-
"email": "[email protected]",
15-
"url": "http://flesler.blogspot.com"
16-
}],
17-
"licenses": [{
18-
"type": "MIT",
19-
"url": "https://github.com/flesler/jquery.scrollTo/blob/master/LICENSE"
20-
}],
21-
"homepage": "https://github.com/flesler/jquery.scrollTo",
22-
"docs": "http://flesler.blogspot.com/2007/10/jqueryscrollto.html",
23-
"bugs": "https://github.com/flesler/jquery.scrollTo/issues",
24-
"download": "https://github.com/flesler/jquery.scrollTo/releases",
25-
"demo": "http://demos.flesler.com/jquery/scrollTo",
26-
"dependencies": {
27-
"jquery": ">=1.8"
28-
}
1+
{
2+
"name": "scrollTo",
3+
"title": "Ariel Flesler's jQuery scrollTo",
4+
"description": "Easy element scrolling using jQuery.",
5+
"keywords": ["browser", "animated", "animation", "scrolling", "scroll", "links", "anchors"],
6+
"version": "1.4.13",
7+
"author": {
8+
"name": "Ariel Flesler",
9+
"email": "[email protected]",
10+
"url": "http://flesler.blogspot.com"
11+
},
12+
"maintainers": [{
13+
"name": "Ariel Flesler",
14+
"email": "[email protected]",
15+
"url": "http://flesler.blogspot.com"
16+
}],
17+
"licenses": [{
18+
"type": "MIT",
19+
"url": "https://github.com/flesler/jquery.scrollTo/blob/master/LICENSE"
20+
}],
21+
"homepage": "https://github.com/flesler/jquery.scrollTo",
22+
"docs": "http://flesler.blogspot.com/2007/10/jqueryscrollto.html",
23+
"bugs": "https://github.com/flesler/jquery.scrollTo/issues",
24+
"download": "https://github.com/flesler/jquery.scrollTo/releases",
25+
"demo": "http://demos.flesler.com/jquery/scrollTo",
26+
"dependencies": {
27+
"jquery": ">=1.8"
28+
}
2929
}

0 commit comments

Comments
 (0)