473,657 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.id 2, 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.id 2.display=none
doesn't work?
Thanks in advance for any suggestion! :o)
Bye,

PC

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


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.i d2, 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.id 2.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*********@my newsgate.net> writes:
I succeeded to get the reference of the "id2" object with
document.ids.id 2, 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.id 2.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/rasterTriangleD OM.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
2804
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 and above. The progress bar code is written in javascript in an external js file (progressbar.js). The web screen is in a seperate jsp file (Registration.jsp). The problem I'm having is that the progress bar is not showing in Netscape 4.75 on a...
1
1772
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
6835
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 these problems is using document.layers. I have Google'd for examples of how to use the document object specifically with Mozilla, but I cannot find anything that explains why my problems occur. Could anyone here see through the included example...
3
3327
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 just the entire 4.X series. Script works fine under IE. I've tried a few things to get it working under Netscape, such as defining a style for the bannerLayer with the style tag, and trying to define the style under the div tag, I've tried the...
3
1220
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 that when you click on the lunch menu, only that menu is visible, and likewise, when you click on the dinner tab, only the dinner menu is visible. This code works like a charm on IE 5.5, but I don't know how to get a workable solution on...
2
1124
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" valign="top"> <div name="decades" id="decades" style="visibility:visible;position:relative; width:235px; z-index:0; display:inline;">
10
54871
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 idea! function closeall() { var objs;
4
3793
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 { display: none; } ..menu {
2
2602
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 in any version of Netscape). Is that correct? Also, what about document.getElementById? When did Internet Explorer start supporting that and when did Netscape start supporting that? I ask because I'm wondering how necessary doing something...
0
8842
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...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7353
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...
1
6176
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
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
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
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
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.