fix for #4216. css now ignores negative numbers for width and height when passed an object of props and vals.

This commit is contained in:
Brandon Aaron 2009-04-22 05:23:53 +00:00
parent 8be5792975
commit 6a049246a1
2 changed files with 11 additions and 5 deletions

View file

@ -8,10 +8,6 @@ var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
jQuery.fn.css = function( name, value ) {
var options = name, isFunction = jQuery.isFunction( value );
// ignore negative width and height values
if ( (name == 'width' || name == 'height') && parseFloat(value) < 0 )
value = undefined;
if ( typeof name === "string" ) {
// Are we setting the style?
if ( value === undefined ) {
@ -55,6 +51,10 @@ jQuery.extend({
if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
return undefined;
// ignore negative width and height values #1599
if ( (name == 'width' || name == 'height') && parseFloat(value) < 0 )
value = undefined;
var style = elem.style || elem, set = value !== undefined;
// IE uses filters for opacity