diff --git a/less/pivot.less b/less/pivot.less index 8b41b55..b7b1446 100644 --- a/less/pivot.less +++ b/less/pivot.less @@ -19,5 +19,5 @@ metro-pivot .headers { .metro-pivot .headers { white-space: nowrap; display: block; clear: both; } .metro-pivot .pivot-item h3, .metro-pivot .headers .header { #headingstyles; font-size: @h2fontSize; display: inline-block; vertical-align: top; padding: 0; cursor: pointer; margin-right:24px; } .metro-pivot .headers .header.current { } -.metro-pivot .items { position: relative; } +.metro-pivot .items { position: relative; overflow: hidden; } .metro-pivot .items .pivotItem { display: block; white-space: normal; text-align: justify; width: 100%; } \ No newline at end of file diff --git a/scripts/jquery.metro.js b/scripts/jquery.metro.js index 3a15de5..a611455 100644 --- a/scripts/jquery.metro.js +++ b/scripts/jquery.metro.js @@ -118,7 +118,8 @@ }, setCurrentItem: function(item, index){ var pivot = this; - + var currentHeight = pivot.items.height(); + pivot.items.height(currentHeight); // hide current item immediately pivot.items.children(".pivotItem.current").hide().removeClass("current"); @@ -128,7 +129,7 @@ item.css({ marginLeft: item.outerWidth() }).show().addClass("current"); // animate it to left - item.animate( { marginLeft: 0 }, pivot.animationDuration, function() { pivot.currentItemChanged(index);}); + item.animate( { marginLeft: 0 }, pivot.animationDuration, function() {pivot.items.height('auto'); pivot.currentItemChanged(index);}); }, 200); },