var objWH = {w:180,h:1000};
var c1 = document.querySelector('.f1');
var c2 = document.querySelector('.f2');
var scale = Math.min(
c1.offsetWidth / objWH.w,
c1.offsetHeight / objWH.h
);
c2.style.width = (objWH.w*scale)+'px';
c2.style.height = (objWH.h*scale)+'px';