My website has a FAQ page that, by default, shows only the questions, not the answers, to prevent clutter (there may be better ways, feel free to make suggestions).
To see an answer, the user has to click on the question, which then will fold open the answer. This is done browser-side, with Javascript and jQuery, like this:
<script type="text/javascript" >
$(document).ready(function(){
$(".trigger").click(function(){
$(this).toggleClass("active").next().slideToggle("fast");
});
});
</script>
The questions are declared with the "trigger" CSS class.
Now, I link to the FAQ questions from other pages, using anchors. This will scroll the page to the question but does not reveal the answer automatically.
I like to reveal the answer when the user clicks on an anchored link to a FAQ question.
How can I accomplish this? Preferably without server-side (php) code, but if that's necessary, I can do that as well.
Here's an example link to my page: