How it Works

<iframe id="product-carousel" src="//assets.getmultipop.com/product-carousel-2" width="100%" height="0" frameborder="0" seamless></iframe>
<div id="product-spacer"></div>
<script>

function resizeProductCarousel(){
    var BREAK_MEDIUM = 480;
    var BREAK_SMALL = 380;

    var ASPECT_NORMAL = 1.77778;
    var ASPECT_MEDIUM = 1.6;
    var ASPECT_SMALL = 1.3;
  
    var height;
    var iframe = document.getElementById('product-carousel');
    var width = iframe.offsetWidth;

    if(width > BREAK_MEDIUM) {
        height = Math.round(width/ASPECT_NORMAL);
    }
    else if(width > BREAK_SMALL) {
        height = Math.round(width/ASPECT_MEDIUM);
    }
    else {
        height = Math.round(width/ASPECT_SMALL);
    }
    iframe.style.height = height + 'px';
}
resizeProductCarousel();
window.addEventListener('resize', function(event){
    resizeProductCarousel();
});
</script>