Is there a way in JavaScript to automatically resize and fill in a block with fixed width using different images with various dimensions?
I came across something similar, but it was in AS2. I'm unsure if it can be translated to JavaScript.
var _loc3 = _caseWidth * 100 / caseItem.item._width;
var _loc2 = _caseHeight * 100 / caseItem.item._height;
caseItem._xscale = caseItem._yscale = _loc3 > _loc2 ? (_loc2) : (_loc3);
caseItem.item._x = -caseItem.item.getBounds(caseItem).xMin + (_caseWidth - caseItem._width) / 2;
caseItem.item._y = -caseItem.item.getBounds(caseItem).yMin;