View Full Version : Iframe

Mar 22nd, 2007, 09:28 PM
Heres the deal I have 1 main iframe that is use all the time. I want another iframe used for different things but I don't want it to be perm. I want know if somehow I can create a link that will hide/show a iframe. or if there is anything of that nature I can do.

Mar 22nd, 2007, 11:13 PM
You'll probably need JavaScript to do this. Maybe try something like this:

<input id="toggle" type="button" value="toggle">
<div id="myframe" style="display: none">
<iframe id="myiframe" src="http://www.codingforums.com"></iframe>

<script type="text/javascript">
window.onload = function() {
objToggle = document.getElementById('toggle');
objToggle.onclick = function() {
objMyframe = document.getElementById('myframe');
objMyframe.style.display = (objMyframe.style.display == 'none') ? 'block' : 'none';

Mar 23rd, 2007, 05:54 AM
oh kool that works perfect for what I need it for thanks a million!