Added setting optimal height to thumbnails
This commit is contained in:
parent
85f6926300
commit
729ed6f6a8
1 changed files with 4 additions and 1 deletions
|
@ -44,7 +44,10 @@ function alignPosts()
|
||||||
var margin = thumbnailOuterWidth - thumbnailInnerWidth;
|
var margin = thumbnailOuterWidth - thumbnailInnerWidth;
|
||||||
var numberOfThumbnailsToFitInRow = Math.ceil(containerWidth / thumbnailOuterWidth);
|
var numberOfThumbnailsToFitInRow = Math.ceil(containerWidth / thumbnailOuterWidth);
|
||||||
var newThumbnailWidth = Math.floor(containerWidth / numberOfThumbnailsToFitInRow) - margin;
|
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()
|
$(function()
|
||||||
|
|
Loading…
Reference in a new issue