.hideFrame { height: 0; width: 0; visibility: hidden; position: absolute; top: -1000px; left: -1000px; }
<iframe id="frame" src="about:blank" width="300" height="300"></iframe> <input type="button" value="hide" onclick="f = document.getElementById('frame'); f.style.display = 'block'; f.style.height = '1px'; f.style.width = '1px'; f.style.visibility = 'hidden'; f.style.position = 'absolute'; f.style.top = '-1000px'; f.style.left = '-1000px';" /> <input type="button" value="show" onclick="f = document.getElementById('frame'); f.style.display = 'block'; f.style.height = '300px'; f.style.width = '300px'; f.style.visibility = 'visible'; f.style.position = 'static'; f.style.top = '0'; f.style.left = '0';" />