473,654 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding CSS class from Netscape 4.x

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="myClassN ame">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.myClas sName.visibilit y = "hide"; to hide it and
document.myClas sName.visibilit y = "show"; to show it.

My CSS for this function is:

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

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

Any suggestions? Right now we are considering having standards-aware
browsers use client-side show/hide ( via
document.getEle mentsByTagName( ) ) and forcing Netscape 4.x to reload
the page, but would prefer to do it all in the browser.
Jul 20 '05 #1
6 1731
tr********@exci te.com (TravelMan) wrote in
news:ca******** *************** ***@posting.goo gle.com:
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/
Jul 20 '05 #2
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.myClas sName.visibilit y = "hide"; to hide it and
document.myClas sName.visibilit y = "show"; to show it.

My CSS for this function is:

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

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


You cannot reference CSS classes like objects. Instead, iterate
through the collection of DIV elements (use document.getEle mentsByName,
document.getEle mentsByTagName 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.

Jul 20 '05 #3
Thomas 'PointedEars' Lahn <Po*********@we b.de> wrote in message news:<3F******* *******@Pointed Ears.de>...
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.myClas sName.visibilit y = "hide"; to hide it and
document.myClas sName.visibilit y = "show"; to show it.

My CSS for this function is:

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


Is the `..' a typo? If not, remove one dot.
</style>

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


You cannot reference CSS classes like objects. Instead, iterate
through the collection of DIV elements (use document.getEle mentsByName,
document.getEle mentsByTagName 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
getElementsByTa gName doesn't work in NN4.x? Is there another way to
get the className for a DIV or a layer?
Jul 20 '05 #4
TravelMan wrote:
Thomas 'PointedEars' Lahn <Po*********@we b.de> wrote in message
news:<3F******* *******@Pointed Ears.de>...
It is called attribution _line_.
TravelMan wrote:
[...]
> <style type="text/css">
> ..myClassName {visibility:hid den;}


Is the `..' a typo? If not, remove one dot.
> </style>
>
> When I use the toggle I get this error: document.myClas sName has no
> properties.


You cannot reference CSS classes like objects. Instead, iterate
through the collection of DIV elements (use document.getEle mentsByName,
document.getEle mentsByTagName 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
getElementsByTa gName doesn't work in NN4.x?


See above. The document.layers[...] collection allows for referencing
positioned layers.
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 referenceToLaye r.visibility is the only way.
(again!) followup-to comp.lang.javas cript

PointedEars

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

Jul 20 '05 #5
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.
Jul 20 '05 #6
TravelMan wrote:
Can you recommend any good books on the DOM and DOM scripting?
follow from here: http://www.w3.org/DOM/
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
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
65750
by: Code Monkee | last post by:
How can the toolbar and menubar be hidden in IE? When opening the window via javascript I can specify 'toolbar=no,menubar=no', which works fine. However if the window already exists how can I remove them? If the browser is Netscape I can use javascript: window.toolbar.visible = false; window.menubar.visible = false; but IE produces the error: "'window.toolbar.visible' is null or not an object".
8
2419
by: TravelMan | last post by:
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.
11
4184
by: Lorenzo Villari | last post by:
I premise I don't know C++ well but... I wondered what is this data hiding thing... I mean, if I can look at the header (and i need it beacuse of the class), then what's hidden? Can someone give me an example of something hidden from the user?
1
6649
by: comp.lang.javascript | last post by:
Using IE5.5+, is it possible to hide options in a select? The following doesn't work: <HTML> <HEAD> <STYLE> SELECT OPTION.orgA{ display:none } .orgB{ display:inline } .orgC{ display:none }
9
3348
by: middletree | last post by:
I'm doing an ASP-built Intranet app, and am having trouble with a bit of code on the menu I am using. I got it from some free site, but I tried emailing the person whose email address is in the code, but that email addy doesn't work anymore. Since it's Intranet, I put an HTML version on the web for you to look at. The links won't work, of course. Address is
17
2909
by: Bob Weiner | last post by:
What is the purpose of hiding intead of overriding a method? I have googled the question but haven't found anything that makes any sense of it. In the code below, the only difference is that when the Poodle is upcast to the Dog (in its wildest dreams) it then says "bow wow" where the bernard always says "woof" (see code). Basically, it appears that I'm hiding the poodle's speak method from everything except the poodle. Why would I...
9
4974
by: bob | last post by:
Hi, I know there exists a good reason why the designers of c++ decided that function hiding should exist. But I don't know why. Can anybody provide a good reason/example of a case where function hiding saves the day. I know there exists one, I'd just like to hear about it. thanks and have a nice day.
3
6565
by: Nicolas Castagne | last post by:
Hi all, I have been wondering for a while why function hiding (in a derived class) exists in C++, e.g. why when writing class Base { void foo( int ) {} }; class Derived: public Base { void foo( char const ) {} };
2
7627
by: subramanian100in | last post by:
Is my following understanding correct ? Data abstraction means providing the interface - that is, the set of functions that can be called by the user of a class. Information hiding means mentioning the class members(functions, typedefs, data) under the access control labels : public, protected, private. Encapsulation means providing the implementation of class member
162
10216
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1592
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.