X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcss.js;h=973462b629616b6775c2614e9baec022453ffedc;hb=a073ee85963518be605018550eeb530180e2287f;hp=b8a1350052688f05b87f3d67641807b68e201148;hpb=8be57929750eac38b0eb331cd99def3d88302cc1;p=jquery.git diff --git a/src/css.js b/src/css.js index b8a1350..973462b 100644 --- a/src/css.js +++ b/src/css.js @@ -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 @@ -120,12 +120,12 @@ jQuery.extend({ }, curCSS: function( elem, name, force ) { - var ret, style = elem.style; + var ret, style = elem.style, filter; // IE uses filters for opacity - if ( !jQuery.support.opacity && name == "opacity" ) { - ret = style.filter && style.filter.indexOf("opacity=") >= 0 ? - (parseFloat( style.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '': + if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) { + ret = (elem.currentStyle.filter || "").match(/opacity=([^)]*)/) ? + (parseFloat(RegExp.$1) / 100) + "" : ""; return ret === "" ?