Right now, I\'m using max-width to scale images to fit. However, they don\'t scale proportionally. Is there a way to cause this to happen? I\'m open to Javascript/jQuery.
<
function resizeBackground() {
var scale=0;
var stageWidth=$(window).width();
var newWidth=$("#myPic").width();
var stageHeight=$(window).height();
var newHeight=$("#myPic").height();
if( $(window).width() > $(window).height() ) {
scale = stageHeight/newHeight;
scale = stageWidth/newWidth;
} else {
scale = stageWidth/newWidth;
scale = stageHeight/newHeight;
}
newWidth = newWidth*scale;
newHeight = newHeight*scale
$("#myPic").width(newWidth);
$("#myPic").height(newHeight);
}