HTML code to hide answers to questions.

Discussion in 'HTML & Website Design' started by Tambo, Mar 26, 2008.

  1. #1
    I'm looking for some HTML code to enter onto my blog wherby I can hide an answer to a question, that is revealed if a user wants to know the answer and clicks/ hovers their mouse over there.

    If anybody is able to help me out, point me in the right direction, it would be greatly appreciated.
     
    Tambo, Mar 26, 2008 IP
  2. LindseyInteractive

    LindseyInteractive Well-Known Member

    Messages:
    2,830
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    175
    #2
    Hello there Tambo,
    This all depends on how you layed the form out, or using a script to do it. If you would like, post the section of the HTML here and I will be more than happy to take a look at it and see if I can resolve this problem for you.
     
    LindseyInteractive, Mar 26, 2008 IP
  3. tarponkeith

    tarponkeith Well-Known Member

    Messages:
    4,758
    Likes Received:
    279
    Best Answers:
    0
    Trophy Points:
    180
    #3
    With CSS or JavaScript, this would be simple; are they allowed?
     
    tarponkeith, Mar 26, 2008 IP
  4. Tambo

    Tambo Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks for the replies.

    It's a blog on blogger I'm hoping to use it with. I don't think they do let you use CSS or Java.

    Essentially, what I'm trying to do is this...

    Host a vocabulary quizz on my writing blog. The question will be a single word, and the reveal will be a definition of that word.
     
    Tambo, Mar 26, 2008 IP
  5. Tambo

    Tambo Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I've just noticed the sub-forum for blogging.

    Would like to apologise for posting this in what might be the wrong place.
     
    Tambo, Mar 26, 2008 IP
  6. Spider-Man

    Spider-Man Banned

    Messages:
    2,684
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hey Tambo, since I see your Location, gotta help out a fellow Scot, it's the law.

    I don't think blogger allow you to use external javascipt files - do they?

    If they do, here's a great example I've used many a time: Expand and Collapse.

    Good luck:D
     
    Spider-Man, Mar 26, 2008 IP
  7. Tambo

    Tambo Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thankyou Spider-man, a bit of tartan solidarity, it's appreciated.

    I don't think I can use external javascript files on blogger (although I'll check that out)

    Elsewise, it's one more reason in a growing list to move to Wordpress.
     
    Tambo, Mar 26, 2008 IP
  8. Spider-Man

    Spider-Man Banned

    Messages:
    2,684
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    0
    #8
    No problem, at least we can hold our heads high after tonights game, for a change:D

    Indeed, WordPress is - IMO - a lot better than Blogger, unless, of course, you're after PR, where you should then stay with Blogger as they tend to get PR for doing nothin' special.

    You could always download WordPress (WordPress v 2.5 is due any day now) - and upload it to a free host, I'd recommend freehostia.com if you only have 1 or 2 sites;)

    Cheers
     
    Spider-Man, Mar 26, 2008 IP
  9. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hmmm, if it's a sort of "self-quiz" where you just want the answers available for people but not visible at first glance... You could have the answers show up on hover with text coloured the same as background and change colour on hover (this will leave a space where the text is though), OR you could have a "css tooltip" where a span holding th info appears on hover... or they could click to another page where the answers lie.

    Some things you can try.
     
    Stomme poes, Mar 26, 2008 IP
  10. immortality

    immortality Peon

    Messages:
    1,512
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Make the answer the same color as the background and just have the users highlight the text to reveal the answer.
     
    immortality, Mar 26, 2008 IP
  11. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #11
    You should be able to use inline JS:

    
    <input type="button" class="button" onclick="document.getElementById('spoiler1').style.display = ''; this.style.display = 'none';" title="Click to show the answer." value="Answer" />
    <div id="spoiler1" style="display: none;"> The Answer is 42 </div>
    
    Code (markup):
    will do it, but you will have to create spoiler1, spoiler2 etc where it says document.getElementById and id=".


    BP
     
    blueparukia, Mar 26, 2008 IP