I want to resize my safari browser window to match the height of a div with id 'po'. I have the following javascript:
var divHeight = document.getElementById('po').offsetHeight;
console.log(divHeight);
divHeight = divHeight + 30;
var y = parseInt(divHeight,10);
var w=window.innerWidth;
window.resizeTo(w,y);
console.log(divHeight);
The output of the console is:
83
113
But the window gets resized to an actual inner height of only 30! Why isn't the window resizing correctly? If I measure the div (it contains a table), the height of the div is indeed 83. So why won't the window size match? How to fix it?