How do I set up a collapsible Question & Answer list

N

NigelB118

I've been asked by my boss to improve our company website and one of the
things i'm trying to do is set up a FAQ's page where you click on the
question and the answer which is normally hidden appears below. Does anyone
have any advice on how I can go about this ??
 
D

Dan L

Here's an easy script. Alter the Q's & A's as you wish.
<head>
<script>
function show(elementID) {
ele = document.getElementById(elementID);
if (ele.style.display == 'none') {
ele.style.display = 'block';
} else {
ele.style.display = 'none';
}
}
</script>
</head>
<body>
Frequently Asked Questions (FAQs)<br>
<a href="#" onclick="show('an1');" >How do you show answers? </a><br>
<div id="an1" class="an" style="display: none;" >Use this script.</div>
<a href="#" onclick="show('an2');" >Is this another question? </a><br>
<div id="an2" class="an" style="display: none;" >Yes, this is another
question. </div>
</body>
 
N

NigelB118

Dan,

Thank you very much for taking the time to reply.

I'm very much a novice with websites having no knowledge of html and as a
result I use Frontpage 2003 in design mode. Do you know if what I want to do
is possible without having to resort to using html ??

Thank you

Nigel
 
S

Stefan B Rusynko

See help on FP Behaviors

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPageNewsGroups/tabid/53/Default.aspx
_____________________________________________


| Dan,
|
| Thank you very much for taking the time to reply.
|
| I'm very much a novice with websites having no knowledge of html and as a
| result I use Frontpage 2003 in design mode. Do you know if what I want to do
| is possible without having to resort to using html ??
|
| Thank you
|
| Nigel
|
| "Dan L" wrote:
|
| > Here's an easy script. Alter the Q's & A's as you wish.
| > <head>
| > <script>
| > function show(elementID) {
| > ele = document.getElementById(elementID);
| > if (ele.style.display == 'none') {
| > ele.style.display = 'block';
| > } else {
| > ele.style.display = 'none';
| > }
| > }
| > </script>
| > </head>
| > <body>
| > Frequently Asked Questions (FAQs)<br>
| > <a href="#" onclick="show('an1');" >How do you show answers? </a><br>
| > <div id="an1" class="an" style="display: none;" >Use this script.</div>
| > <a href="#" onclick="show('an2');" >Is this another question? </a><br>
| > <div id="an2" class="an" style="display: none;" >Yes, this is another
| > question. </div>
| > </body>
| >
| > "NigelB118" wrote:
| >
| > > I've been asked by my boss to improve our company website and one of the
| > > things i'm trying to do is set up a FAQ's page where you click on the
| > > question and the answer which is normally hidden appears below. Does anyone
| > > have any advice on how I can go about this ??
 
E

Earl Gardner

If you are already using a javascript for something else on your Q&A (I am
using SitePal to speak the answers) is it still possible to incorporate this
script alongside it so that the questions are only written once?

Regards

Earl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top