X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=3fb59f8d5e52f68303023c2549c7ab895318f10b;hb=139b03af7c2d7e70a26591424f82f09a02132198;hp=67cb147c774e03e61a7088075f81b8e4bdeb3442;hpb=b59c94d5c23c0b1ec4b2506be0aed6b0578f19f3;p=jquery.git diff --git a/src/core.js b/src/core.js index 67cb147..3fb59f8 100644 --- a/src/core.js +++ b/src/core.js @@ -1014,9 +1014,11 @@ jQuery.extend({ jQuery.each({ parent: "a.parentNode", - parents: "jQuery.parents(a)", + parents: "jQuery.dir(a,'parentNode')", next: "jQuery.nth(a,2,'nextSibling')", prev: "jQuery.nth(a,2,'previousSibling')", + nextAll: "jQuery.dir(a,'nextSibling')", + prevtAll: "jQuery.dir(a,'previousSibling')", siblings: "jQuery.sibling(a.parentNode.firstChild,a)", children: "jQuery.sibling(a.firstChild)", contents: "jQuery.nodeName(a,'iframe')?a.contentDocument||a.contentWindow.document:jQuery.makeArray(a.childNodes)" @@ -1078,10 +1080,20 @@ jQuery.each( { }; }); -jQuery.each( [ "height", "width" ], function(i,n){ +jQuery.each( [ "Height", "Width" ], function(i,name){ + var n = name.toLowerCase(); + jQuery.fn[ n ] = function(h) { - return h == undefined ? - ( this.length ? jQuery.css( this[0], n ) : null ) : - this.css( n, h.constructor == String ? h : h + "px" ); + return this[0] == window ? + jQuery.browser.safari && self["inner" + name] || + jQuery.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) || + document.body["client" + name] : + + this[0] == document ? + Math.max( document.body["scroll" + name], document.body["offset" + name] ) : + + h == undefined ? + ( this.length ? jQuery.css( this[0], n ) : null ) : + this.css( n, h.constructor == String ? h : h + "px" ); }; });