You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Show/Hide Content on Fri Jun 22, 2012 10:32 am

NvRDream Admin

avatar

Making Show/Hide Content
Showing and hiding content

This tutorial will tell you how to make show/hide a content
<a onclick ="javascript:ShowHide('HiddenDiv_1')" href="javascript:;" >Show/Hide Content</a>
<div id="HiddenDiv_1" style="DISPLAY: none" >The Content</div>

<script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script>
Code:
Code:
<a onclick ="javascript:ShowHide('HiddenDiv_1')" href="javascript:;" >Show/Hide Content</a>
<div id="HiddenDiv_1" style="DISPLAY: none" >The Content</div>

<script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script>



If you want to put more show/hide content, You'll have to put the different code that colored red
<a onclick ="javascript:ShowHide('HiddenDiv_1')" href="javascript:;" >Show/Hide Content</a>
<div id="HiddenDiv_1" style="DISPLAY: none" >The Content</div>

<script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script>

That it.


Notice : This tutorial is copyrighted by FreshArtz. You may not publish it on anywhere without written permission from the administrators.

View user profile

2 Re: Show/Hide Content on Mon Jul 02, 2012 11:07 am

Thanks for share this Verrell!

View user profile http://freshartz2.indonesianforum.net/

View previous topic View next topic Back to top  Message [Page 1 of 1]

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

 


Sitemap
FreshArtz
FreshArtz © 2012
Design by Verrell123
Donate
Demo Page

About
We are Web Design and Coding forum, we will help member how to coding and design website, there many category about web design and coding.