Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


HTMl and CSS

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

fatjames
World Chat Champion



Joined: 09 Jul 2011
Karma :

PostPosted: 10:54 - 19 Nov 2014    Post subject: HTMl and CSS Reply with quote

Without JQuery if possible.

I trying to do a page with questions and answers. I have a vision of a list of questions and when you click one the anwer appears below. Or another way to put it, I want to hide all of the answers unless the question is clicked.

Does anyone have any ideas of examples of this?

I'm reluctant to put a list of questions at the top and anchor the answers as I'd like it to look a bit better than that.

Many thanks
Jim
 Back to top
View user's profile Send private message You must be logged in to rate posts

noobRider
World Chat Champion



Joined: 23 Sep 2012
Karma :

PostPosted: 11:43 - 19 Nov 2014    Post subject: Reply with quote

Question:

Code:
<span id="q1"
 onclick="document.getElementById('answer1').style.display = (document.getElementById('answer1').style.display == 'block' ? 'none' : 'block');"
 onmouseover="this.style.cursor='pointer';">Your question should be here </span>


Answer:

Code:
<div id="answer1" style="display:none;">Your answer should be here</div>


should do it (BCF is messing up the first bit of code, the text is getting stripped off somehow)
____________________
Licence: Nov 2012, Bikes: Suzuki GN125, Moto Guzzi Strada 750, Triumph Sprint ST 955i x 2
AnPhonEh: I need plans, I need contingency plans also, I need back up contingency plans
 Back to top
View user's profile Send private message You must be logged in to rate posts

fatjames
World Chat Champion



Joined: 09 Jul 2011
Karma :

PostPosted: 14:07 - 19 Nov 2014    Post subject: Reply with quote

Mr Rider, this is most helpful. Thank you very much.
 Back to top
View user's profile Send private message You must be logged in to rate posts
Old Thread Alert!

The last post was made 11 years, 68 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.06 Sec - Server Load: 1.22 - MySQL Queries: 13 - Page Size: 35.84 Kb