Skip to content

Commit

Permalink
Add 25px of padding to the height normalization. Improves responsiven…
Browse files Browse the repository at this point in the history
…ess and visuals.
  • Loading branch information
Chris Hallberg committed Apr 6, 2016
1 parent b2ac2ad commit 319b29d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@
<? endif; ?>
<?
$script = <<<JS
var normalizeHeightCount = $('#similar-items-carousel img').length;
function normalizeHeights() {
if(--normalizeHeightCount > 0) return;
var tallest = 0;
var items = $('#similar-items-carousel .hover-overlay');
items.each(function() { //add heights to array
if(tallest < $(this).height()) {
tallest = $(this).height();
}
});
items.css('min-height',tallest + 'px');
items.css('min-height', (tallest+25) + 'px');
}
$('#similar-items-carousel img').load(normalizeHeights);
JS;
?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?>
<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?>

0 comments on commit 319b29d

Please sign in to comment.