summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKorri <korrigan33@gmail.com>2013-08-09 12:09:54 -0400
committerKorri <korrigan33@gmail.com>2013-08-09 12:09:54 -0400
commitc81f11d9a4330b0f69708e82756d4c9a55c5d85a (patch)
treebe118083cb0e33da38a5472f2e7b3d54e0bc663c
parent100979cba3754ecdb305b022bc52151be04a091c (diff)
downloadjQuery.equalHeights-c81f11d9a4330b0f69708e82756d4c9a55c5d85a.zip
jQuery.equalHeights-c81f11d9a4330b0f69708e82756d4c9a55c5d85a.tar.gz
jQuery.equalHeights-c81f11d9a4330b0f69708e82756d4c9a55c5d85a.tar.bz2
Allow multiple data-heights on the same page
-rw-r--r--jquery.equalheights.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/jquery.equalheights.js b/jquery.equalheights.js
index 35c9d37..17f6b73 100644
--- a/jquery.equalheights.js
+++ b/jquery.equalheights.js
@@ -24,8 +24,10 @@
};
// auto-initialize plugin
- var target = $('[data-heights="equal"]').attr('data-targets'),
- init = '[data-heights="equal"] ' + target;
- $(init).equalHeights();
+ $('[data-heights="equal"]').each(function(){
+ var $this = $(this),
+ target = $this.data('targets');
+ $this.find(target).equalHeights();
+ });
})(jQuery);