Skip to content

Commit 1b0bd67

Browse files
committed
Fixed conflicted setting with .animate(), updated demo
1 parent b85b356 commit 1b0bd67

7 files changed

Lines changed: 157 additions & 127 deletions

File tree

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": "2.0.0",
3+
"version": "2.0.1",
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+
2.0.1
2+
[Fix]
3+
- Fixed "queue" setting conflicts with $().animate(), forced to always get there as true
4+
15
2.0.0
26
[Feature]
37
- All settings are passed to jQuery.animate() meaning it now supports even more settings

demo/css/style.css

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ body{
44
font-family: Verdana, sans-serif;
55
background-color: #DDD;
66
}
7-
ul,li,h1,h2,h3,p{
7+
ul,li,h1,h2,h3,h4,p{
88
list-style:none;
99
padding:0;
1010
margin:0;
@@ -13,7 +13,9 @@ ul,li,h1,h2,h3,p{
1313
border:1px solid black;
1414
background-color:white;
1515
}
16-
.part h3{
16+
.part h3,
17+
.part h4,
18+
.part h4 a {
1719
color:#933;
1820
}
1921
#toc{
@@ -59,21 +61,25 @@ ul,li,h1,h2,h3,p{
5961
#toc a{
6062
color:#69C;
6163
}
62-
div.section{
64+
.section{
6365
border:1px black solid;
6466
width:950px;
6567
padding:10px;
6668
margin: 5px 0;
6769
position:relative;
6870
clear:both;
6971
}
70-
div.section h3{
72+
.section h3{
7173
margin-bottom:10px;
74+
margin-left: 8px;
7275
}
73-
div.section li{
76+
.section h4{
77+
margin:10px 0 10px 8px;
78+
}
79+
.section li{
7480
float:left;
7581
}
76-
div.pane{
82+
.pane{
7783
overflow:auto;
7884
clear:left;
7985
margin: 10px 0 0 10px;
@@ -104,19 +110,20 @@ ul.elements{
104110
ul.elements li p{
105111
color:#666;
106112
}
107-
#pane-options ul.elements li{
113+
#pane-settings ul.elements li{
108114
margin:5px;
109115
}
110-
#pane-options{
116+
#pane-settings{
111117
margin-bottom:10px;
112118
}
113119
ul.links{
114120
height:20px;
115121
overflow:hidden;
122+
padding-left: 5px;
116123
}
117124
ul.links a{
118125
color:#69C;
119-
margin:0pt 5px;
126+
margin:0 0 0 5px;
120127
}
121128
.clear{
122129
clear:left;

demo/index.html

Lines changed: 126 additions & 109 deletions
Large diffs are not rendered by default.

jquery.scrollTo.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
66
* @projectDescription Easy element scrolling using jQuery.
77
* @author Ariel Flesler
8-
* @version 2.0.0
8+
* @version 2.0.1
99
*/
1010
;(function(define) {
1111
'use strict';
@@ -42,9 +42,8 @@
4242
// Speed is still recognized for backwards compatibility
4343
duration = duration || settings.duration;
4444
// Make sure the settings are given right
45-
settings.queue = settings.queue && settings.axis.length > 1;
46-
47-
if (settings.queue) {
45+
var queue = settings.queue && settings.axis.length > 1;
46+
if (queue) {
4847
// Let's keep the overall duration
4948
duration /= 2;
5049
}
@@ -122,7 +121,7 @@
122121
}
123122

124123
// Queueing axes
125-
if (!i && settings.queue) {
124+
if (!i && queue) {
126125
// Don't waste time animating, if there's no need.
127126
if (prev !== attr[key]) {
128127
// Intermediate animation
@@ -137,6 +136,9 @@
137136

138137
function animate(callback) {
139138
var opts = $.extend({}, settings, {
139+
// The queue setting conflicts with animate()
140+
// Force it to always be true
141+
queue: true,
140142
duration: duration,
141143
complete: callback && function() {
142144
callback.call(elem, targ, settings);

jquery.scrollTo.min.js

Lines changed: 2 additions & 2 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,6 +1,6 @@
11
{
22
"name": "jquery.scrollto",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Easy element scrolling using jQuery.",
55
"main": "jquery.scrollTo.js",
66
"license": "MIT",

0 commit comments

Comments
 (0)