Previous Message
Next Message

Best Way to Show/Hide Text

Sent by Christian Heilmann on 14 March 2006 17:05


> I'm wondering if there is a definitive way to show/hide text using
> JavaScript and CSS. I'm working on a project which involves a map
> with various states that are linked. When a state is clicked content
> appears which is relevant to that state. Click another state, the old
> content is hidden and the new content appears.

This is off-topic for the CSS list. However, the best option in this
case is the following:

- make the site work without JavaScript
- don't make the CSS dependent on the JavaScript, without the JS the
page should still work, now it is a bunch of elements covering each
other.
- Use JavaScript to apply a dynamic class to a parent element and hide
the nested elements with that one in your CSS.

I'll create a quick demo :-)
--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: