scripting a button to hide & display an iFrame
Page 1 of 1
scripting a button to hide & display an iFrame
I want to make a script that will allow me to press a button to hide an iframe code, kinda like the button on the right side to hide the widgets, anyone know how to do this?
Guest- Guest
Re: scripting a button to hide & display an iFrame
Could this work?
.. Goold luck
- Code:
<div align="center">
<input type=button value="Click here to Open!" style='width:200px;margin:0px;padding:0px;' onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Close!'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Click here to Open!'; }"/>
</div>
<div style="min-height: 0px; background-color: #FFFFFF;">
<div style="display: none" align="center">
Textish/IFramish
</div>
</div>
.. Goold luck
Saxaca- Forumember
- Posts : 539
Reputation : 26
Language : Markup.
Re: scripting a button to hide & display an iFrame
thanks saxaca, where do i put the iframe code? i tried to replace "Textish/IFramish" with the iframe code but the button wouldn't open the frame
**EDIT: Okay this code works perfectly as a widget, however the iFrame code I have set up is on announcements, its for me chatbox, the code doesnt seem to work the same when when its not a widget
**EDIT: Okay this code works perfectly as a widget, however the iFrame code I have set up is on announcements, its for me chatbox, the code doesnt seem to work the same when when its not a widget
Guest- Guest
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum