Added in .height(fn) and .width(fn) support. Fixes #5915.

This commit is contained in:
jeresig 2010-01-23 20:49:59 -05:00
parent 781fe8b80d
commit 4f9aa62a85
2 changed files with 63 additions and 22 deletions

View file

@ -23,6 +23,13 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
if ( !elem ) {
return size == null ? null : this;
}
if ( jQuery.isFunction( size ) ) {
return this.each(function( i ) {
var self = jQuery( this );
self[ type ]( size.call( this, i, self[ type ]() ) );
});
}
return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode