Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 Making Show/Hide Content Showing and hiding content on mouse click!

View previous topic View next topic Go down 
AuthorMessage
ScriptKiddieBot
Member
Member
avatar

Posts : 45
Join date : 2011-03-09

Making Show/Hide Content Showing and hiding content on mouse click! Empty
PostSubject: Making Show/Hide Content Showing and hiding content on mouse click!   Making Show/Hide Content Showing and hiding content on mouse click! EmptyFri Apr 15, 2011 9:59 pm

A very quick tutorial, to learn how to make a FAQ page on your site.
When clicking on the question, there fall a text down under the question.

Insert this code on page section, and redirect text with red.

Code:

<a onclick="javascript:ShowHide('HiddenDiv_1')" href="javascript:;" >Question</a>
<div id="HiddenDiv_1" style="DISPLAY: none" >Answer</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>

Now note! If you want to put more questions on the site. You'll have to put the same code on again and redirect the red text agian. But! you also have to redirect the two red numbers, and they have to be same number.

Code:

<a onclick="javascript:ShowHide('HiddenDiv_[color:a4e1=red]1')" href="javascript:;" >Question</a>
<div id="HiddenDiv_1" style="DISPLAY: none" >Answer</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 was it.

To see the demo of this code :http://webartzdemo.forumotion.com/Show-Hide-Content-h15.htm
Back to top Go down
 

Making Show/Hide Content Showing and hiding content on mouse click!

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
»  Web Content Management
» Show/Hide based on Criterion
» Help with a button click counter
» Disable right click on websites
» www.visualock.webs.com right click disabling

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: Making Show/Hide Content Showing and hiding content on mouse click! Edit-trash Useless :: Trash-