Added setting optimal height to thumbnails

This commit is contained in:
Marcin Kurczewski 2014-07-30 08:53:38 +02:00
parent 85f6926300
commit 729ed6f6a8

View file

@ -44,7 +44,10 @@ function alignPosts()
var margin = thumbnailOuterWidth - thumbnailInnerWidth;
var numberOfThumbnailsToFitInRow = Math.ceil(containerWidth / thumbnailOuterWidth);
var newThumbnailWidth = Math.floor(containerWidth / numberOfThumbnailsToFitInRow) - margin;
container.find('.thumb').css('width', newThumbnailWidth + 'px');
var newThumbnailHeight = newThumbnailWidth * thumbnailHeight / thumbnailWidth;
container.find('.thumb').css({
width: newThumbnailWidth + 'px',
height: newThumbnailHeight + 'px'});
}
$(function()