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. 6 1728
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.
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in message news:<3F**************@PointedEars.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.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?
TravelMan wrote: Thomas 'PointedEars' Lahn <Po*********@web.de> wrote in message news:<3F**************@PointedEars.de>...
It is called attribution _line_. 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.
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.
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.
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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 }
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |