diff --git a/jquery.syncheight.js b/jquery.syncHeight.js similarity index 97% rename from jquery.syncheight.js rename to jquery.syncHeight.js index 602fb13..3792820 100755 --- a/jquery.syncheight.js +++ b/jquery.syncHeight.js @@ -97,7 +97,9 @@ // optional sync refresh on resize event ... if (options.updateOnResize === true) { $(window).bind('resize.syncHeight', function(){ - $(e).syncHeight(); + window.requestAnimationFrame(function(){ + $(e).syncHeight(); + }); }); } return this; diff --git a/jquery.syncHeight.min.js b/jquery.syncHeight.min.js index b7a953c..e2544e4 100644 --- a/jquery.syncHeight.min.js +++ b/jquery.syncHeight.min.js @@ -1,7 +1,7 @@ /* jQuery-syncHeight - v1.5.0 * https://github.com/ginader/syncHeight -* Copyright (c) 2013 Dirk Ginader; +* Copyright (c) 2015 Dirk Ginader; * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ -(function(e){var t=function(){var e=0,t=[["min-height","0px"],["height","1%"]],n=/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[],i=n[1]||"",h=n[2]||"0";return"msie"===i&&7>h&&(e=1),{name:t[e][0],autoheightVal:t[e][1]}};e.getSyncedHeight=function(n){var i=0,h=t();return e(n).each(function(){e(this).css(h.name,h.autoheightVal);var t=parseInt(e(this).css("height"),10);t>i&&(i=t)}),i},e.fn.syncHeight=function(n){var i={updateOnResize:!1,height:!1},h=e.extend(i,n),s=this,a=0,c=t().name;return a="number"==typeof h.height?h.height:e.getSyncedHeight(this),e(this).each(function(){e(this).css(c,a+"px")}),h.updateOnResize===!0&&e(window).resize(function(){e(s).syncHeight()}),this},e.fn.unSyncHeight=function(){var n=t().name;e(this).each(function(){e(this).css(n,"")})}})(jQuery); \ No newline at end of file +!function(a){var b=function(){var a=0,b=[["min-height","0px"],["height","1%"]],c=/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[],d=c[1]||"",e=c[2]||"0";return"msie"===d&&7>e&&(a=1),{name:b[a][0],autoheightVal:b[a][1]}};a.getSyncedHeight=function(c){var d=0,e=b();return a(c).each(function(){a(this).css(e.name,e.autoheightVal);var b=parseInt(a(this).css("height"),10);b>d&&(d=b)}),d},a.fn.syncHeight=function(c){var d={updateOnResize:!1,height:!1},e=a.extend(d,c),f=this,g=0,h=b().name;return g="number"==typeof e.height?e.height:a.getSyncedHeight(this),a(this).each(function(){a(this).css(h,g+"px")}),e.updateOnResize===!0&&a(window).bind("resize.syncHeight",function(){window.requestAnimationFrame(function(){a(f).syncHeight()})}),this},a.fn.unSyncHeight=function(){a(window).unbind("resize.syncHeight");var c=b().name;a(this).each(function(){a(this).css(c,"")})}}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index d1142bb..2a54682 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-uglify": "~0.1.2", + "grunt-contrib-uglify": "~0.8.0", "grunt-contrib-watch": "~0.3.1", "grunt-contrib-concat": "~0.1.3", "grunt-remove-logging": "~0.1.0"