1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Newbie Wepage help

Discussion in 'HTML & JavaScript' started by bookbuster, Apr 9, 2012.

  1. bookbuster

    bookbuster Newbie

    Joined:
    Mar 22, 2009
    Messages:
    42
    Likes Received:
    9
    Location:
    L.A.
    How do I write a paragraph for each question on the right-hand sidebar, when you click *read more* I want to show the paragraph on the left of the page. Would love it if it didn't refresh the entire page. Thank you!

    http://www.californiabugs.net
     
  2. darkmonk

    darkmonk Regular Member

    Joined:
    Nov 21, 2007
    Messages:
    226
    Likes Received:
    52
    Thats a cool looking page. You can do what you want with jQuery or just plain JavaScript. Just have a function called in onclick where you send some kind of identifier, and then change what is visible on the left based on it. Something like what's described in this link:

    Code:
    http://stackoverflow.com/questions/5836710/css-javascript-show-hide-div-using-a-css-class
    But extended to take a variable that you can switch on in an if-else block to show the appropriate content.
     
    • Thanks Thanks x 1