git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made it so that the last return value is always returned from handle() (unless one...
[jquery.git]
/
src
/
fx
/
fx.js
diff --git
a/src/fx/fx.js
b/src/fx/fx.js
index
4c38413
..
075d1ab
100644
(file)
--- a/
src/fx/fx.js
+++ b/
src/fx/fx.js
@@
-336,10
+336,13
@@
jQuery.fn.extend({
jQuery.each( prop, function(name, val){
var e = new jQuery.fx( self, opt, name );
if ( val.constructor == Number )
jQuery.each( prop, function(name, val){
var e = new jQuery.fx( self, opt, name );
if ( val.constructor == Number )
- e.custom( e.cur(), val );
+ e.custom( e.cur() || 0, val );
else
e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
});
else
e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
});
+
+ // For JS strict compliance
+ return true;
});
},
});
},
@@
-376,7
+379,7
@@
jQuery.extend({
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
- easing: fn && easing || easing && easing.constructor != Function && easing || (jQuery.easing.swing ? "swing" : "linear")
+ easing: fn && easing || easing && easing.constructor != Function && easing
};
opt.duration = (opt.duration && opt.duration.constructor == Number ?
};
opt.duration = (opt.duration && opt.duration.constructor == Number ?
@@
-421,18
+424,10
@@
jQuery.extend({
timers: [],
timers: [],
- /*
- * I originally wrote fx() as a clone of moo.fx and in the process
- * of making it small in size the code became illegible to sane
- * people. You've been warned.
- */
-
fx: function( elem, options, prop ){
fx: function( elem, options, prop ){
- var z = this;
-
- // The styles
- var y = elem.style;
+ var z = this, y = elem.style,
+ isprop = elem[prop] != null && y[prop] == null;
// Simple function for setting a style value
z.a = function(){
// Simple function for setting a style value
z.a = function(){
@@
-442,8
+437,14
@@
jQuery.extend({
if ( prop == "opacity" )
jQuery.attr(y, "opacity", z.now); // Let attr handle opacity
else {
if ( prop == "opacity" )
jQuery.attr(y, "opacity", z.now); // Let attr handle opacity
else {
- y[prop] = parseInt(z.now) + "px";
- y.display = "block"; // Set display property to block for animation
+ if ( isprop )
+ elem[prop] = parseInt(z.now);
+ else
+ y[prop] = parseInt(z.now) + "px";
+
+ // Set display property to block for height/width animations
+ if ( prop == "height" || prop == "width" )
+ y.display = "block";
}
};
}
};
@@
-454,6
+455,7
@@
jQuery.extend({
// Get the current size
z.cur = function(){
// Get the current size
z.cur = function(){
+ if ( isprop ) return elem[prop];
var r = parseFloat( jQuery.curCSS(elem, prop) );
return r && r > -10000 ? r : z.max();
};
var r = parseFloat( jQuery.curCSS(elem, prop) );
return r && r > -10000 ? r : z.max();
};
@@
-564,7
+566,7
@@
jQuery.extend({
var p = n / options.duration;
// Perform the easing function, defaults to swing
var p = n / options.duration;
// Perform the easing function, defaults to swing
- z.now = jQuery.easing[options.easing](p, n, firstNum, (lastNum-firstNum), options.duration);
+ z.now = jQuery.easing[options.easing || (jQuery.easing.swing ? "swing" : "linear")](p, n, firstNum, (lastNum-firstNum), options.duration);
// Perform the next step of the animation
z.a();
// Perform the next step of the animation
z.a();