View Single Post
Old 08-28-2011, 01:52 AM   PM User | #6
Squishy435
New Coder

 
Join Date: May 2010
Location: Saint Louis, MO
Posts: 31
Thanks: 6
Thanked 0 Times in 0 Posts
Squishy435 is an unknown quantity at this point
Quote:
Originally Posted by jmrker View Post
Slight modification from last post to include a bit more JS and some CSS.

Only advantage is that click on question box shows/hides the answer
and the box makes it easier to know where to put cursor for mouse click.

Code:
<!DOCTYPE HTML>
<html>
<head>
<title> FAQ Display </title>
<style type="text/css">
 .FAQ { cursor:hand; cursor:pointer;
        border:1px solid red; width:50%; }
 .FAA { display:none; }
</style>
<script type="text/javascript">
function toggle(Info) {
  var CState = document.getElementById(Info);
  CState.style.display = (CState.style.display != 'block')
                       ? 'block' : 'none';
}
</script>
</head>
<body>
<h2>FAQ section</h2>

<DIV class="FAQ" onclick="toggle('faq1')">
 whassup?
 <div id="faq1" class="FAA">nadda</div>
</DIV>

<DIV class="FAQ" onclick="toggle('faq2')">
 whassup now?
 <div id="faq2" class="FAA">still nadda</div>
</DIV>

<DIV class="FAQ" onclick="toggle('faq3')">
 How about now?
 <div id="faq3" class="FAA">How many times must I say <b>nothing</b>?</div>
</DIV>

</body>
</html>
This is probably more like that I'm looking for. Thank you very much. Just a little modifications that I have to make, and then I should be good to go.
Squishy435 is offline   Reply With Quote