X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjquery%2Fjquery.js;h=ab7564fd7fc254da25af79fb2bbe0ffb93f72e59;hb=766c3765bd30e6a643eff99da0f1c293aa2897bd;hp=5446ed2ce11952f350dd78645c14ca8c2222c2a0;hpb=e218628dda347f5aa9241046780f3345713d7a35;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 5446ed2..ab7564f 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1,5 +1,5 @@ /* - * jQuery - New Wave Javascript + * jQuery @VERSION - New Wave Javascript * * Copyright (c) 2006 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) @@ -98,7 +98,7 @@ if ( typeof $ != "undefined" ) * @desc Creates a div element (and all of its contents) dynamically, * and appends it to the element with the ID of body. Internally, an * element is created and it's innerHTML property set to the given markup. - * It is therefore both quite flexible and limited. + * It is therefore both quite flexible and limited. * * @name $ * @param String expr An expression to search with, or a string of HTML to create on the fly. @@ -190,7 +190,7 @@ var $ = jQuery; jQuery.fn = jQuery.prototype = { /** - * The current SVN version of jQuery. + * The current version of jQuery. * * @private * @property @@ -198,7 +198,7 @@ jQuery.fn = jQuery.prototype = { * @type String * @cat Core */ - jquery: "$Rev$", + jquery: "@VERSION", /** * The number of elements currently matched. @@ -1384,10 +1384,6 @@ jQuery.extend({ o.className += ( o.className ? " " : "" ) + c; }, remove: function(o,c){ - /* - o.className = !c ? "" : - o.className.replace( - new RegExp("(^|\\s*\\b[^-])"+c+"($|\\b(?=[^-]))", "g"), "");*/ if( !c ) { o.className = ""; } else { @@ -1455,14 +1451,16 @@ jQuery.extend({ }); return p == "height" ? oHeight : oWidth; - } else if ( p == "opacity" && jQuery.browser.msie ) - return parseFloat( jQuery.curCSS(e,"filter").replace(/[^0-9.]/,"") ) || 1; + } return jQuery.curCSS( e, p ); }, curCSS: function(elem, prop, force) { var ret; + + if (prop == 'opacity' && jQuery.browser.msie) + return jQuery.attr(elem.style, 'opacity'); if (!force && elem.style[prop]) { @@ -1497,7 +1495,7 @@ jQuery.extend({ for ( var i = 0; i < a.length; i++ ) { if ( a[i].constructor == String ) { // trim whitespace, otherwise indexOf won't work as expected - a[i] = $.trim(a[i]); + a[i] = jQuery.trim(a[i]); var table = ""; @@ -1567,7 +1565,7 @@ jQuery.extend({ enabled: "!a.disabled", disabled: "a.disabled", checked: "a.checked", - selected: "a.selected", + selected: "a.selected || jQuery.attr(a, 'selected')", // Form elements text: "a.type=='text'", @@ -1833,11 +1831,27 @@ jQuery.extend({ disabled: "disabled", checked: "checked" }; + + // IE actually uses filters for opacity ... elem is actually elem.style + if (name == "opacity" && jQuery.browser.msie && value != undefined) { + // IE has trouble with opacity if it does not have layout + // Would prefer to check element.hasLayout first but don't have access to the element here + elem['zoom'] = 1; + if (value == 1) // Remove filter to avoid more IE weirdness + return elem["filter"] = elem["filter"].replace(/alpha\([^\)]*\)/gi,""); + else + return elem["filter"] = elem["filter"].replace(/alpha\([^\)]*\)/gi,"") + "alpha(opacity=" + value * 100 + ")"; + } else if (name == "opacity" && jQuery.browser.msie) { + return elem["filter"] ? parseFloat( elem["filter"].match(/alpha\(opacity=(.*)\)/)[1] )/100 : 1; + } + + // Mozilla doesn't play well with opacity 1 + if (name == "opacity" && jQuery.browser.mozilla && value == 1) value = 0.9999; if ( fix[name] ) { if ( value != undefined ) elem[fix[name]] = value; return elem[fix[name]]; - } else if( value == undefined && $.browser.msie && elem.nodeName && elem.nodeName.toUpperCase() == 'FORM' && (name == 'action' || name == 'method') ) { + } else if( value == undefined && jQuery.browser.msie && elem.nodeName && elem.nodeName.toUpperCase() == 'FORM' && (name == 'action' || name == 'method') ) { return elem.getAttributeNode(name).nodeValue; } else if ( elem.getAttribute != undefined ) { if ( value != undefined ) elem.setAttribute( name, value );