summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jquery.equalheights.js10
-rw-r--r--jquery.equalheights.min.js4
2 files changed, 8 insertions, 6 deletions
diff --git a/jquery.equalheights.js b/jquery.equalheights.js
index 9267419..17f6b73 100644
--- a/jquery.equalheights.js
+++ b/jquery.equalheights.js
@@ -6,7 +6,7 @@
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
- * @version 1.3
+ * @version 1.4
*/
(function($) {
@@ -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);
diff --git a/jquery.equalheights.min.js b/jquery.equalheights.min.js
index 660349e..7b40b88 100644
--- a/jquery.equalheights.min.js
+++ b/jquery.equalheights.min.js
@@ -6,6 +6,6 @@
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
- * @version 1.3
+ * @version 1.4
*/
-(function($){$.fn.equalHeights=function(){var maxHeight=0,$this=$(this);$this.each(function(){var height=$(this).innerHeight();if(height>maxHeight){maxHeight=height}});return $this.height(maxHeight)};var target=$('[data-heights="equal"]').attr('data-targets'),init='[data-heights="equal"] '+target;$(init).equalHeights()})(jQuery);
+(function(e){e.fn.equalHeights=function(){var t=0,n=e(this);n.each(function(){var n=e(this).innerHeight();if(n>t){t=n}});return n.height(t)};e('[data-heights="equal"]').each(function(){var t=e(this),n=t.data("targets");t.find(n).equalHeights()})})(jQuery)