The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

scripting a button to hide & display an iFrame

View previous topic View next topic Go down

scripting a button to hide & display an iFrame

Post by Guest on 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?

Guest
Guest


Back to top Go down

Re: scripting a button to hide & display an iFrame

Post by Saxaca on 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
Forumember

Male Posts : 539
Reputation : 26
Language : Markup.

Back to top Go down

Re: scripting a button to hide & display an iFrame

Post by Guest on 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

Guest
Guest


Back to top Go down

View previous topic View next topic Back to top


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