Skip to content

Instantly share code, notes, and snippets.

@PavelGonzales
Created May 3, 2018 07:32
Show Gist options
  • Save PavelGonzales/d5463050fb59126f82efd25ee6f8c17d to your computer and use it in GitHub Desktop.
Save PavelGonzales/d5463050fb59126f82efd25ee6f8c17d to your computer and use it in GitHub Desktop.
// Высчитываем ширину ряда что-бы вычислить процентную ширину каждой картинки.
const rowWidth = wrap.offsetWidth;
// Высчитываем высоту ряда.
let rowHeight = rowWidth / aspect - horizontalPadding;
if ((rowHeight > maxHeight) && this.totalImages === 1) {
rowHeight = maxHeight;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment