Skip to content

Instantly share code, notes, and snippets.

@kennyledet
Last active August 29, 2015 14:27
Show Gist options
  • Save kennyledet/3b0d48ffb116161ff5cd to your computer and use it in GitHub Desktop.
Save kennyledet/3b0d48ffb116161ff5cd to your computer and use it in GitHub Desktop.
Legacy code for dynmically calculating and setting CSS prop for min-height on results container of product grid items
if ( $(window).width() <= 720 ) {
var _card = $('.product-grid-item');
var cardLen = _card.length;
var cardHeight = _card.height();
var totalCardHeight = cardLen * cardHeight;
$('#results-container').css('min-height', (totalCardHeight+cardHeight) +'px');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment