Hidden Text Script needed

robfenn's picture

He has: 471 posts

Joined: Jun 2005

Hi Guys,

I want to make a web based flow chart where you click on a bit of text and it then displays further stuff which was previously hidden.

I'm sure i've seen it before, but am not sure if it was Javascript or not.

Any ideas?

Cheers

-Rob

pr0gr4mm3r's picture

He has: 1,502 posts

Joined: Sep 2006

I've seen it done before with CSS and JavaScript.

To hide something, add the CSS property "visibility: hidden;". To show it, use this line of JavaScript:
javascript:document.getElementById('something').style.visibility='visible''

He has: 629 posts

Joined: May 2007

You can also do this with CSS. The classic article on this is Eric Meyer's Pure CSS Popups.

Having said that, JavaScript gives you a lot more options. Some nice variations demo'd at www.codylindley.com/blogstuff/js/jquery/ using jQuery.

Cordially, David
--
delete from internet where user_agent="MSIE" and version < 8;

robfenn's picture

He has: 471 posts

Joined: Jun 2005

Brilliant guys, thanks!

robfenn's picture

He has: 471 posts

Joined: Jun 2005

Managed to get something working now, one problem i had was finding a solution so multiple divs could be chosen. Feel free to use it.

http://www.sixthsense-esp.co.uk/sanchi/test.htm

They have: 2 posts

Joined: Oct 2007

Instead of visibilty:hidden, you could also use display:none.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.