HighDots Forums  

Hiding CSS class from Netscape 4.x

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Hiding CSS class from Netscape 4.x in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Hiding CSS class from Netscape 4.x - 10-14-2003 , 05:07 PM






I'm trying to do a show/hide of several elements on a page and can't
get it working in Netscape 4.x. All other Windows browsers are
working.

My elements all have the same class name. <div
class="myClassName">stuff</div>
I cannot use ID because I don't know how many will appear as they are
dynamic recordsets. Netscape seems to work OK with IDs but not CSS
classes.

For Netscape 4.x I have coded in my javascript:
document.myClassName.visibility = "hide"; to hide it and
document.myClassName.visibility = "show"; to show it.

My CSS for this function is:

<style type="text/css">
..myClassName {visibility:hidden;}
</style>

When I use the toggle I get this error: document.myClassName has no
properties.

Any suggestions? Right now we are considering having standards-aware
browsers use client-side show/hide ( via
document.getElementsByTagName() ) and forcing Netscape 4.x to reload
the page, but would prefer to do it all in the browser.

Reply With Quote
  #2  
Old   
kayodeok
 
Posts: n/a

Default Re: Hiding CSS class from Netscape 4.x - 10-14-2003 , 05:26 PM






travel-man (AT) excite (DOT) com (TravelMan) wrote in
news:ca0c0fd6.0310141307.7e9dbc38 (AT) posting (DOT) google.com:

Quote:
I'm trying to do a show/hide of several elements on a page and
can't get it working in Netscape 4.x. All other Windows browsers
are working.

Why not hide all CSS from Netscape 4.x and provide Structural Markup?
You can't support buggy browsers for ever...

How to hide CSS from buggy browsers
http://w3development.de/css/hide_css_from_browsers/

--
Kayode Okeyode
http://www.kayodeok.co.uk/weblog/


Reply With Quote
  #3  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Hiding CSS class from Netscape 4.x - 10-14-2003 , 05:42 PM



TravelMan wrote:
Quote:
I'm trying to do a show/hide of several elements on a page and can't
get it working in Netscape 4.x. All other Windows browsers are
working.
Sorry, but I really doubt that the below is working with *any* user agent.

Quote:
For Netscape 4.x I have coded in my javascript:
document.myClassName.visibility = "hide"; to hide it and
document.myClassName.visibility = "show"; to show it.

My CSS for this function is:

style type="text/css"
..myClassName {visibility:hidden;}
Is the `..' a typo? If not, remove one dot.

Quote:
/style

When I use the toggle I get this error: document.myClassName has no
properties.
You cannot reference CSS classes like objects. Instead, iterate
through the collection of DIV elements (use document.getElementsByName,
document.getElementsByTagName or document.layers, depending on the DOM[1])
and change the `className' property of each element to the name of a
CSS class where the `visibility' property has the value of `show'.


F'up2 cljs

PointedEars
___________
[1] Possibly you find http://pointedears.de.vu/scripts/dhtml.js useful
in this regard.



Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: Hiding CSS class from Netscape 4.x - 10-15-2003 , 08:54 AM



Thomas 'PointedEars' Lahn <PointedEars (AT) web (DOT) de> wrote

Quote:
TravelMan wrote:
I'm trying to do a show/hide of several elements on a page and can't
get it working in Netscape 4.x. All other Windows browsers are
working.

Sorry, but I really doubt that the below is working with *any* user agent.

For Netscape 4.x I have coded in my javascript:
document.myClassName.visibility = "hide"; to hide it and
document.myClassName.visibility = "show"; to show it.

My CSS for this function is:

style type="text/css"
..myClassName {visibility:hidden;}

Is the `..' a typo? If not, remove one dot.

/style

When I use the toggle I get this error: document.myClassName has no
properties.

You cannot reference CSS classes like objects. Instead, iterate
through the collection of DIV elements (use document.getElementsByName,
document.getElementsByTagName or document.layers, depending on the DOM[1])
and change the `className' property of each element to the name of a
CSS class where the `visibility' property has the value of `show'.


F'up2 cljs

PointedEars
___________
[1] Possibly you find http://pointedears.de.vu/scripts/dhtml.js useful
in this regard.
How do you get a handle on the className for a DIV when
getElementsByTagName doesn't work in NN4.x? Is there another way to
get the className for a DIV or a layer?


Reply With Quote
  #5  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Hiding CSS class from Netscape 4.x - 10-15-2003 , 09:21 AM



TravelMan wrote:

Quote:
Thomas 'PointedEars' Lahn <PointedEars (AT) web (DOT) de> wrote in message
news:<3F8C6DC7.5040803 (AT) PointedEars (DOT) de>...
It is called attribution _line_.

Quote:
TravelMan wrote:
[...]
style type="text/css"
..myClassName {visibility:hidden;}

Is the `..' a typo? If not, remove one dot.

/style

When I use the toggle I get this error: document.myClassName has no
properties.

You cannot reference CSS classes like objects. Instead, iterate
through the collection of DIV elements (use document.getElementsByName,
document.getElementsByTagName or document.layers, depending on the DOM[1])
^^^^^^^^^^^^^^^
and change the `className' property of each element to the name of a
CSS class where the `visibility' property has the value of `show'.
[...]

How do you get a handle on the className for a DIV when
getElementsByTagName doesn't work in NN4.x?
See above. The document.layers[...] collection allows for referencing
positioned layers.

Quote:
Is there another way to get the className for a DIV or a layer?
Sorry, NS4-DOM seems not to provide a className property,
so referenceToLayer.visibility is the only way.


(again!) followup-to comp.lang.javascript

PointedEars

P.S.: Please don't quote what you are not referring to.



Reply With Quote
  #6  
Old   
AT
 
Posts: n/a

Default Re: Hiding CSS class from Netscape 4.x - 10-15-2003 , 05:11 PM



Can you recommend any good books on the DOM and DOM scripting? I'm new
to using that and already am impressed by the power of what it offers.
Thanks.

Reply With Quote
  #7  
Old   
William Tasso
 
Posts: n/a

Default Re: Hiding CSS class from Netscape 4.x - 10-15-2003 , 05:20 PM



TravelMan wrote:
Quote:
Can you recommend any good books on the DOM and DOM scripting?
follow from here: http://www.w3.org/DOM/

Quote:
I'm new
to using that and already am impressed by the power of what it offers.
just be sure you ensure your pages work in UAs without script support e.g.
googlebot.

--
William Tasso - http://WilliamTasso.com




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.