473,320 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Layers and Netscape 4.x

Hello everybody,
I looked for my problem googling, but I found always similar answers
about layer visualization.
I expose my problem, I have tre layers:

LAYER1
LAYER2
LAYER3

and I need to show/hide the layer I want, but in the way that the
layers below move them upper in the void position.
Es:

LAYER1
LAYER3

No problem with Explorer and Mozilla, using the "display" style setting
it on "block" and "none", I obtain the effect I want.
The real problem is about Netscape 4.x compatibility, I found a script
the simulate the "block" effect, but it's too complex to integrate it
in my application.
But I noticed one thing using the following HTML:

<BODY>
<DIV Name="id1" ID="id1" style="display:show">
LAYER1<BR>
</DIV>
<DIV Name="id2" ID="id2" style="display:show">
LAYER2<BR>
</DIV>
<DIV Name="id3" ID="id3" style="display:show">
LAYER3<BR>
</DIV>
</BODY>

I this way all the three browsers display the layers, but if I
replace "show" with "none", LAYER2 disappears leaving its position to
LAYER3, and it works with Netscape 4.x too!
Actually I'm trying to obtain the same effect using Javascript, but I
still didn't find any solution.
I succeeded to get the reference of the "id2" object with
document.ids.id2, but using:

eval('document.ids.' + element + '.display=none');

it doesn't work, the Javascript console displays "none is not defined.".
Why style="display:none" works and document.ids.id2.display=none
doesn't work?
Thanks in advance for any suggestion! :o)
Bye,

PC

Inviato da www.mynewsgate.net
Jul 23 '05 #1
4 1427


PsychoCrow wrote:

No problem with Explorer and Mozilla, using the "display" style setting
it on "block" and "none", I obtain the effect I want.
The real problem is about Netscape 4.x compatibility, I found a script
the simulate the "block" effect, but it's too complex to integrate it
in my application.


But you will need such a script, Netscape 4's layout machine like Opera
6's layout machine doesn't allow for a dynamic reflow caused by script
changing the CSS display property so if you need the effect you need to
write or use a script that not only hides your layers but also moves
them up and down as necessary to fill layout space.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2
Lee
PsychoCrow said:
But I noticed one thing using the following HTML:

<BODY>
<DIV Name="id1" ID="id1" style="display:show">
LAYER1<BR>
</DIV>
<DIV Name="id2" ID="id2" style="display:show">
LAYER2<BR>
</DIV>
<DIV Name="id3" ID="id3" style="display:show">
LAYER3<BR>
</DIV>
</BODY>

I this way all the three browsers display the layers, but if I
replace "show" with "none", LAYER2 disappears leaving its position to
LAYER3, and it works with Netscape 4.x too!
Actually I'm trying to obtain the same effect using Javascript, but I
still didn't find any solution.
I succeeded to get the reference of the "id2" object with
document.ids.id2, but using:

eval('document.ids.' + element + '.display=none');

it doesn't work, the Javascript console displays "none is not defined.".
Why style="display:none" works and document.ids.id2.display=none
doesn't work?


That works as the page is being rendered, but changing the
value of the display style attribute won't work in 4.x after
the page has been displayed.

The error you're getting is because "none" needs to be in
quotes.

You shouldn't use eval(), anyway. The correct syntax would
be:
document.ids[element].display="none";

Again, though, it won't work after the page has been rendered.

Jul 23 '05 #3
"PsychoCrow" <87*********@mynewsgate.net> writes:
I succeeded to get the reference of the "id2" object with
document.ids.id2, but using:
Surpricing. What is "ids"?

I would suggest using
document.layers['id2']
in Netscape 4.
eval('document.ids.' + element + '.display=none');
Never use eval to access properties. You should probably never use
eval at all.

This can be better written as:
document.ids[element].display = none;
That also makes the error easier to spot ...
it doesn't work, the Javascript console displays "none is not defined.".
.... that "none" should be a string, so, all in all, try:

document.layers[element].display = "none";
Why style="display:none" works and document.ids.id2.display=none
doesn't work?


Because "none" is not a variable, as the error says, and should be a string.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #4
Lee
PsychoCrow said:

Hello everybody,
I looked for my problem googling, but I found always similar answers
about layer visualization.
I expose my problem, I have tre layers:

LAYER1
LAYER2
LAYER3

and I need to show/hide the layer I want, but in the way that the
layers below move them upper in the void position.
Es:

LAYER1
LAYER3

No problem with Explorer and Mozilla, using the "display" style setting
it on "block" and "none", I obtain the effect I want.


It is possible to accomplish this effect in NN4.x, but how to do
it depends on what the content is and whether or not it's worth
the effort of maintaining a completely separate page for one old
browser.

You can't split a form across layers in NN4, but you can rewrite
the entire content of the document when you want to show or hide
some part of the content.

Jul 23 '05 #5

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

Similar topics

1
by: Lizzy | last post by:
I have an internet application which has a progress bar show whenever the customer is requesting data from the server. This progress bar is coded to work in both Netscape 4.75 and above and IE 5.0...
1
by: Chris Leonard | last post by:
Hi. Can anyone help me please. If the syntax for IE is: document.getElementById(layerID) What if I want to use layers ? document.layers ?????????
6
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of...
3
by: Crimefighter | last post by:
I'm not a javascript guy, but the use of this banner rotator script has given me fits. I know a few causes of the problem thus far, one being the layer tags aren't supported under Netscape 7.1...
3
by: Jeannie | last post by:
Can anyone help me adjust this code so that it works in Netscape 4.x? I have am developing a website for a restaurant and the menu page has menus for lunch and dinner. Two images work as tabs, so...
2
by: Dobedani | last post by:
Dear All, I have 2 layers which I want to show alternatively, depending on 2 radio buttons with the name "interval". The 2 layers are defined in a table: <td colspan="3" height="84"...
10
by: InvisibleMan | last post by:
Hi, Thanks for any help in advance... Okay, I have the JS listed below that calls for the display of the (DIV) tag... cookie function not included, as don't feel its necessary but you'll get the...
4
by: ashkaan57 | last post by:
Hi, I am using the following code to show/hide part of an html page. It works in Netscape and Firefox but dies in IE: "Error: document.layers is null or not an object" <style> ..noshow {...
2
by: yawnmoth | last post by:
As I understand it, document.layers only works in Netscape 4+ (ie. it doesn't work in any version of Internet Explorer), while document.all only works in Internet Explorer 4+ (ie. it doesn't work...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.