summaryrefslogtreecommitdiffstats
path: root/jquery.matchHeight.js
diff options
context:
space:
mode:
authorliabru <liambrum@gmail.com>2014-05-02 00:05:39 +0100
committerliabru <liambrum@gmail.com>2014-05-02 00:05:39 +0100
commit8f5f13f096480d042a57d5a669177ea545c7eabd (patch)
treebbed1bdf6d482b1cfb7235093fb67818076c694e /jquery.matchHeight.js
parenta3a058c2a37be1a43be9f548c04c6baf9036b4f9 (diff)
downloadjquery-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.js18
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;