"Hidden" style answers for questions in an FAQ

Associate
Joined
17 Jun 2005
Posts
1,080
Location
London
Bare with me guys as this may be hard to explain.

I'm currently updating my department's Intranet site and it's a bit restrictive because it's all done through a content manager (I'm used to coding from scratch in Notepad etc.)

I've created an FAQ page and would like to implement the feature whereby when you click on a question, the answer appears underneath it (where it was previously hidden).

Make sense?

I'm limited to what I can actually do (e.g. I have to "pick" CSS styles and can't edit or create any myself). I doubt I can add anything in the header etc. because all I literally can do is create tables (only selecting number of columns and rows, mind) and insert pictures and text. Shocking.

Although another department has managed to implement a news ticker on their page, so I'm hoping the IS admin might grant me additional access!

Thanks for the help.
 
It should be doable using javascript but it sounds as though you are pretty limited with what you can do within the system. If you can only CSS styles and do nothing to edit them you have no chance.
 
It should be doable using javascript but it sounds as though you are pretty limited with what you can do within the system. If you can only CSS styles and do nothing to edit them you have no chance.

This sort of works, it's not great and not pretty as you cannot hide again, but may be the best you can do:

Code:
  <style type="text/css">
  	a.show div.hide { display: none; }
  	a.show:visited div.hide { display: block; }
  </style>

Code:
<a href="#" class="show">Test
<div class="hide">This is another test</div></a>

Is there no way you can get at the source of the content using the editor? If so you could put a script tag and include jQuery, then do a very simple expression to do this on all questions.
 
You could do it by a bit of frig :

If you have CMS access, then you can embed the styles and jscript in the page. It depends whether your CMS filters the page content though - if it filters, then sorry not possible.

You'll definelty need jscript to do a hide/reveal toggle. About 8 lines of jscript code should do it.
 
Back
Top Bottom