Currently executing
jQuery("#myid").css("top", top)
.css("left", left)
.etc...
with top = null is equivalent to executing css("top") without parameter. Thus an integer value is returned from css("top", top) call instead of "this". Thus executing of the consecutive operation css("left", left) results in an error.
I guess it would be more convenient to return this in case of css("xxx", null) calls.
I achieved this by adding
if (arguments.length > 1 && value == undefined) return this;
line to the css() method. Though I'm not sure that this is the best solution as I'm not very well familiar with jQuery internals.
css: function( key, value ) {
// ignore negative width and height values
if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
value = undefined;
if (arguments.length > 1 && value == undefined) return this;
return this.attr( key, value, "curCSS" );
},
Regards,
telega