X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=sidebyside;f=jquery%2Fjquery.js;h=7fd11462a683e7baa71fab228ee49407abaf9940;hb=2d31381a5722719190be4a0dde630a0b9ea70fa5;hp=2bde96f32177f61c219c7a3895691dd88cce5cdb;hpb=57403c1be2e9408e44b02628bae0bbe0680d1c4b;p=jquery.git diff --git a/jquery/jquery.js b/jquery/jquery.js index 2bde96f..7fd1146 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -61,7 +61,7 @@ function jQuery(a,c) { if ( m ) a = jQuery.clean( [ m[1] ] ); // Watch for when an array is passed in - this.get( a.constructor == Array || a.length && a[0].nodeType ? + this.get( a.constructor == Array || a.length && a[0] != undefined && a[0].nodeType ? // Assume that it's an array of DOM Elements jQuery.merge( a, [] ) : @@ -308,7 +308,7 @@ jQuery.fn = jQuery.prototype = { * @param Object value The value to set the property to. */ css: function( key, value ) { - return this.attr( key, value, "css" ); + return this.attr( key, value, "curCSS" ); }, /** @@ -1076,8 +1076,8 @@ new function() { * @type jQuery * @param String type An event type */ - trigger: function( type ) { - jQuery.event.trigger( this, type ); + trigger: function( type, data ) { + jQuery.event.trigger( type, data, this ); } }; @@ -1107,18 +1107,18 @@ new function() { this.length ? this[0][n] : null : this.attr( n, h ); }; - } - - var css = "width,height,top,left,position,float,overflow,color,background".split(","); - + }; + + var css = "width,height,top,left,position,float,overflow,color,background".split(","); + for ( var i in css ) new function() { var n = css[i]; jQuery.fn[ i ] = function(h) { return h == undefined ? - this.length ? jQuery.css( this[0], n ) : null : + ( this.length ? jQuery.css( this[0], n ) : null ) : this.css( n, h ); }; - } + }; } @@ -1177,7 +1177,11 @@ jQuery.extend({ return p == "height" ? oHeight : oWidth; } - + + return jQuery.curCSS( e, p ); + }, + + curCSS: function(e,p) { var r; if (e.style[p]) @@ -1288,7 +1292,7 @@ jQuery.extend({ find: function( t, context ) { // Make sure that the context is a DOM Element - if ( context && context.getElementsByTagName == undefined ) + if ( context && context.nodeType == undefined ) context = null; // Set the correct context (if none is provided)