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