You can set the height and width of your popup using the window.resizeTo (preferedWidth, preferedHeight) function. If you want to set this inside the popup not from the parent window than self.resizeTo (preferedWidth, preferedHeight); will do the job for you.
The best suggestion is to keep your content inside a div, like a div with id 'content', so that you can use it for a popup.
<head> <script type="text/javascript"> function resizeMe() { height = document.getElementById("content").offsetHeight; width = document.getElementById("content").offsetWidth; self.resizeTo(width+20, height+100); } </script> </head> <body onload="resizeMe();">
This should be enough to solve your problem.
source share