Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Help? Need some code like this

    Hi,

    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!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #4
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

    Thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •