From cbac493e7df7f9de39dc5b48a883d5f66275576f Mon Sep 17 00:00:00 2001 From: Matt Banks Date: Tue, 17 Sep 2013 13:17:12 -0400 Subject: [PATCH] fix bug with $.height() in jQuery 1.8+ with double padding, fixes #6 --- README.md | 6 +++++- jquery.equalheights.js | 4 ++-- jquery.equalheights.min.js | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 364e81f..f0b2a7f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # jQuery Simple Equal Heights -Version 1.5.0 +Version 1.5.1 ## Summary @@ -50,6 +50,10 @@ See `example.html` in examples folder. ### Changelog +#### Version 1.5.1 + +* fix bug with $.height() in jQuery 1.8+ with double padding when `box-siding` is set to `border-box` + #### Version 1.5.0 * added Grunt for linting and minification diff --git a/jquery.equalheights.js b/jquery.equalheights.js index 6d2502e..d05c700 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.5.0 + * @version 1.5.1 */ (function($) { @@ -20,7 +20,7 @@ if ( height > maxHeight ) { maxHeight = height; } }); - return $this.height(maxHeight); + return $this.css('height', maxHeight); }; // auto-initialize plugin diff --git a/jquery.equalheights.min.js b/jquery.equalheights.min.js index 96d848b..6bba224 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.5.0 + * @version 1.5.1 */ -!function(a){a.fn.equalHeights=function(){var b=0,c=a(this);return c.each(function(){var c=a(this).innerHeight();c>b&&(b=c)}),c.height(b)},a("[data-equal]").each(function(){var b=a(this),c=b.data("equal");b.find(c).equalHeights()})}(jQuery); \ No newline at end of file +!function(a){a.fn.equalHeights=function(){var b=0,c=a(this);return c.each(function(){var c=a(this).innerHeight();c>b&&(b=c)}),c.css("height",b)},a("[data-equal]").each(function(){var b=a(this),c=b.data("equal");b.find(c).equalHeights()})}(jQuery); \ No newline at end of file