The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

scripting a button to hide & display an iFrame

Go down

scripting a button to hide & display an iFrame Empty scripting a button to hide & display an iFrame

Post by Guest October 11th 2010, 8:55 pm

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?
avatar
Guest
Guest


Back to top Go down

scripting a button to hide & display an iFrame Empty Re: scripting a button to hide & display an iFrame

Post by Saxaca October 11th 2010, 9:27 pm

Could this work?

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 thumleft
Saxaca
Saxaca
Forumember

Male Posts : 539
Reputation : 26
Language : Markup.

Back to top Go down

scripting a button to hide & display an iFrame Empty Re: scripting a button to hide & display an iFrame

Post by Guest October 11th 2010, 11:42 pm

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
avatar
Guest
Guest


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum