diff options
author | liabru <liambrum@gmail.com> | 2014-05-02 00:05:39 +0100 |
---|---|---|
committer | liabru <liambrum@gmail.com> | 2014-05-02 00:05:39 +0100 |
commit | 8f5f13f096480d042a57d5a669177ea545c7eabd (patch) | |
tree | bbed1bdf6d482b1cfb7235093fb67818076c694e /jquery.matchHeight.js | |
parent | a3a058c2a37be1a43be9f548c04c6baf9036b4f9 (diff) | |
download | jquery-match-height-8f5f13f096480d042a57d5a669177ea545c7eabd.zip jquery-match-height-8f5f13f096480d042a57d5a669177ea545c7eabd.tar.gz jquery-match-height-8f5f13f096480d042a57d5a669177ea545c7eabd.tar.bz2 |
added matchHeight('remove')
Diffstat (limited to 'jquery.matchHeight.js')
-rw-r--r-- | jquery.matchHeight.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/jquery.matchHeight.js b/jquery.matchHeight.js index 28532a7..6ff0065 100644 --- a/jquery.matchHeight.js +++ b/jquery.matchHeight.js @@ -7,6 +7,24 @@ (function($) { $.fn.matchHeight = function(byRow) { + + // handle matchHeight('remove') + if (byRow === 'remove') { + var that = this; + + // remove fixed height from all selected elements + this.css('height', ''); + + // remove selected elements from all groups + $.each($.fn.matchHeight._groups, function(key, group) { + group.elements = group.elements.not(that); + }); + + // TODO: cleanup empty groups + + return this; + } + if (this.length <= 1) return this; |