View Full Version : How do I collapse the answer to a question?

10-22-2012, 04:44 PM
I want to have an FAQ page but I want users to be able to expand and collapse the answers.

10-22-2012, 05:06 PM
Hi Tommy,

How fluent are you in Javascript and CSS?

Others: Is there a built in DW way to do this?

10-22-2012, 05:32 PM
I am not fluent. I was hoping their was a way to do it through the tool. I have a problem with saying no to my boss and telling him I cannot do something, so I just figure it out.

10-22-2012, 06:55 PM
If your DW version has Spry, it should be pretty easy from there too. </guess>


10-23-2012, 01:29 AM
for multiple then a spry accordian would do it i would agree, check jquery also as i dont think this will be built in dw.

here is a working snippet if you want to get creative
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>


<script language="javascript">
function toggle() {
var ele = document.getElementById("toggleText");
var text = document.getElementById("displayText");
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "show";
else {
ele.style.display = "block";
text.innerHTML = "close the answer";
<p>heres a question . if you want to kow the answer to life the universe and everything</p>
<a id="displayText" href="javascript:toggle();">click Here for the answer</a>
<div id="toggleText" style="display: none"><h1>42</h1></div>

10-23-2012, 01:38 AM
infact some useful explained ideas for you using jquery.