var firstDiv=document.getElementById("firstDiv"); var initialHeight = firstDiv.clientHeight; // var initialWidth = firstDiv.clientWidth; var possibleNewHeight = window.innerHeight; // var possibleNewWidth = window.innerWidth; var finalHeight = 0; if (possibleNewHeight>initialHeight){ finalHeight = possibleNewHeight; } else { finalHeight = initialHeight; } // alert(finalHeight); // if (finalHeight>670){ // finalHeight=450; // } firstDiv.style.height=finalHeight+"px"; document.getElementById("firstDiv").style.marginTop = (-30).toString() + "px" // firstDiv.style.position="relative"; // firstDiv.style.left=-(possibleNewWidth-initialWidth)/2+30+"px"; // firstDiv.style.width=possibleNewWidth-20+"px"; // // var works1 = document.getElementById("height"); // works1.style.background="blue"; // var works2 = document.getElementById("works2"); // var works1heigh = works1.clientHeight; // var works2heigh = works2.clientHeight; // alert(works1heigh+" ; "+works2heigh) // if (works1heigh>works2heigh){ // works2.style.height=works1heigh+"px"; // }else{ // works1.style.height=works2heigh+"px"; // }