Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > CSS and Javascript

CSS and Javascript
Thread Tools
pumpkinapo
Junior Member
Join Date: Aug 2000
Location: Califon, NJ
Status: Offline
Reply With Quote
Nov 6, 2002, 12:06 PM
 
Hello. I need help with some CSS and Javascript. I have a dropdown box that when changed I want to execute a fuction that will change the visibility of a CSS ID.

I'm having trouble trying to find out what Javascript code to use to change the visibility. Can anyone help?

Thanks,
Peter
Peter Leing
17" 1.67GHz PowerBook
450MHz G4 Cube
     
hyperizer
Dedicated MacNNer
Join Date: Jan 2001
Location: Santa Fe
Status: Offline
Reply With Quote
Nov 8, 2002, 07:44 PM
 
Put two classes (or IDs) in your stylesheet. One of them should have the property:

display: none;

Then use Javascript to write out a div. Have it choose which of the two classes to write out based on what the user selected. (This won't work in all browsers, of course. OmniWeb, for example, doesn't support CSS well.)

This <a href="http://www.alistapart.com/stories/alternate/">A List Apart article</a> explains a pretty good style switcher.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 10:49 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,