aboutsummaryrefslogtreecommitdiffstats
path: root/src/dimensions.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-01-23 20:49:59 -0500
committerjeresig <jeresig@gmail.com>2010-01-23 20:49:59 -0500
commit4f9aa62a858f28b8ed310ac73f9d2cd788bf1eed (patch)
treec311dabf761c9cf611a60466794e4de5c60bcda3 /src/dimensions.js
parent781fe8b80d08b287e4c6e4ca408f773c6a1f3b2d (diff)
downloadjquery-4f9aa62a858f28b8ed310ac73f9d2cd788bf1eed.tar.gz
jquery-4f9aa62a858f28b8ed310ac73f9d2cd788bf1eed.zip
Added in .height(fn) and .width(fn) support. Fixes #5915.
Diffstat (limited to 'src/dimensions.js')
-rw-r--r--src/dimensions.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dimensions.js b/src/dimensions.js
index 3acbb1d76..aeaaa78ba 100644
--- a/src/dimensions.js
+++ b/src/dimensions.js
@@ -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