View Full Version : Help? Need some code like this

01-24-2012, 02:04 AM

First time poster here, I hope you can help me. Word Press forums won't respond.

I need a plugin or code like on the page here http://www.gsprushfit.com/faq

Basically I need something so that when you click any of the 22 questions the answer drops down below it.

I have 25 questions and want my FAQ page to be like this one.

I did use this one:

<img src="info.jpg" onclick="$('#info').toggle()" /><br />
<div id="info" style="display:none">Information about your picture </div>

But it kind of sucks to make 25 .jpgs and the even bigger bummer when you are say half way down the page, click one of the questions, the answer roles out but it shoots you to the top of the page and you have to scroll back down again.

Any help would be much appreciated. Thanks! :thumbsup:

01-24-2012, 02:17 AM
Hello bonerville,
Look at the source on the page you linked to. The answer is in a hidden span that becomes visible when you click on the question. There is also a little jQuery involved there.

See if this demo helps you - http://davidwalsh.name/jquery-sliders

01-24-2012, 02:23 AM
That link you posted is perfect! Thank you so much!

Yeah, I've looked at the code on the link I posted for hours... can't figure it out.

Thanks again!

01-24-2012, 02:36 AM
One question...... there is three steps there on that page http://davidwalsh.name/jquery-sliders

I understand the HTML part

The CSS part..... do I add that for all pages globally? Do I add that to the CSS page that word press has created? Will that mess up anything else on the site?

And then where do I put the The jQuery JavaScript part?