News

Log In Sponsors
Partner Sites





Re: Putting a 'close' button in a frameset



You can either remove the element (using the element.parentNode.removeChild(element)), or by toggling it's display property to show/hide at anyone's desire. Example: [code:cqtkzh9u] <a href="#" onclick=" var f1=document.getElementById('frame1'); try{f1.parentNode.removeChild(f1);} catch(e){alert('First frame already removed.');} return false;">Remove First Iframe</a> || <a href="#" onclick=" var f2=document.getElementById('frame2'); if(f2.style.display=='none'){ f2.style.display=''; this.innerHTML = 'Hide 2nd Iframe';} else{f2.style.display='none'; this.innerHTML = 'Show 2nd Iframe';} ">Hide 2nd Iframe</a><br><br> <iframe src="http://www.yahoo.com" id="frame1" style="border:0px;"></iframe> <iframe src="http://www.google.com" id="frame2" style="border:0px;"></iframe> [/code:cqtkzh9u] Hope that helps.

Click here to read the whole forum topic