Hello,
I've got a trouble with my script, i want to show a <div> on Netscape
and it doesn't work:
Here is the script
//navigators identification
var ie4=(document.all && !document.getElementById)? true:false
var ie5=(document.all && document.getElementById)? true:false
var n4=(document.layers)? true:false
var n6=(!document.all && document.getElementById)? true:false
// creation of three div
var links=3;
var floatinglinks=new Array("Flats", "leisures", "Rate");
//function which hides all the div
function menu(number)
{
for (i=0; i<links;i++)
{
if(ie4||ie5)
{
document.all[floatinglinks[i]].style.visibility="hidden";
}
else if(n4)
{
document.layers[floatinglinks[i]].visibility="hide";
}
else if(n6)
{
document.getElementById[floatinglinks[i]].style.visibility="hidden";
}
}
// showing the div thanks to "number"
if(ie4||ie5)
{
document.all[floatinglinks[number]].style.visibility="visible";
}
if(n4)
{
document.layers[floatinglinks[number]].visibility="show";
}
if(n6)
{
document.getElementById[floatinglinks[number]].style.visibility="visible";
}
}
</script>
******************* end of the script**********************
Then in the body:
Access to the function in the menu with "onclick"
<td> <img src="images/bouton_off.jpg" id="bouton_1" alt="flats"
title="flats"/> <a id="flats" class="orange" href="#"
onclick="menu(0)">Flats</a></td>
One on the div to show
<div id="flats" style="position:relative; z-index:2; left:106px;
top:-395px;
width:250px; height:150px; visibility: hidden;">
<!--contenu-->
</div>
Here is the probleme the div doesn't work on Netscape and the
Javascript console says :
document.getElementById[floatinglinks[i]] has no properties
What should i change in the script or in the body ?
Thanks for your answers !
Telemak. 6 1381
I haven't looked at your code at all, except to note that
you have two different capitalizations for Flats/flats. var floatinglinks=new Array("Flats", "leisures", "Rate"); <div id="flats" style="position:relative; z-index:2; left:106px; top:-395px; width:250px; height:150px; visibility: hidden;">
HTH,
Csaba Gabor
Ok there is a big mistake but even i change the Flats into flats it
doesn't work anymore.
What should i do ?
thanks for your answer .
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Ok there is a big mistake but even i change the Flats into flats it
doesn't work anymore.
What should i do ?
thanks for your answer .
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Telemak wrote: Hello, I've got a trouble with my script, i want to show a <div> on Netscape and it doesn't work:
<snip>
document.getElementById[floatinglinks[number]].style.visibility="visible";
^ ^
document.getElementById(floatinglinks[number]).style.visibility="visible";
use parenthesis, not square brackets, with getElementById(...)
<snip>
<div id="flats" style="position:relative; z-index:2; left:106px; top:-395px; width:250px; height:150px; visibility: hidden;">
Are you sure the div will be visible with "top:-395px;", maybe for
testing purposes set top:0; left:0; you've got things working.
Good Luck,
Mike
Hi,
Which Netscape? 4.x or 6?
For older Netscape you'll have to write <layer></layer>.
<div></div> doesn't get a look at <div></div>.
I cretaed a js file http://www.caoxuan.com/cxk/webart/goodies/laydiv.js
Just to modify the layers and divs for different objects. http://www.caoxuan.com/cxk/webart/go...ndexDhtml.html
Kien
gui bus <bu*****@free.fr> wrote in message news:<40*********************@news.frii.net>... Ok there is a big mistake but even i change the Flats into flats it doesn't work anymore.
What should i do ?
thanks for your answer .
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
mscir <ms***@access4less.com.net.org.uk> wrote in message news:<10*************@corp.supernews.com>...
Thanks for your help Mike, with parenthesis it works perfectly !!
Sincerly
guillaume. Telemak wrote: Hello, I've got a trouble with my script, i want to show a <div> on Netscape and it doesn't work: <snip> document.getElementById[floatinglinks[number]].style.visibility="visible"; ^ ^ document.getElementById(floatinglinks[number]).style.visibility="visible"; use parenthesis, not square brackets, with getElementById(...)
<snip>
<div id="flats" style="position:relative; z-index:2; left:106px; top:-395px; width:250px; height:150px; visibility: hidden;">
Are you sure the div will be visible with "top:-395px;", maybe for testing purposes set top:0; left:0; you've got things working.
Good Luck, Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: Whitney |
last post by:
On the left side of the main webpage I have some menu options that
have a drop-down feature that is controlled with javascript. You click
on the main heading and the links for that section show up....
|
by: mscir |
last post by:
I was calling a function in a js file from an image onClick event, but
someone still using Netscape 4 (!) complained that it didn't work. I
read that img onClick doesn't work in Netscape 4, so...
|
by: Dennis |
last post by:
This may be easy for most but I can't get this thing to work. I
believe I followed all the instructions but when I click on the link
no window opens just the default IE page cannot display. Here is...
|
by: Max |
last post by:
This instruction don't work in netscape 6
<script language="javascript" src="/pippo.js"></script>
In 4.8 /ie5/ie6 ok !!!
Can you help me ?
Thanks
|
by: TIBM |
last post by:
Hi. I've posted this question on another newsgroup, but I haven't received any answers..
I have a login page where users input userID and password and click a Login button. Before calling the ...
|
by: Don Munroe |
last post by:
This one has me stumped. I have three web applications running on two
different servers. The first that works fine is hosted by a .Net hosting
company. Everyone that uses it has no problems...
|
by: DJG79 |
last post by:
Hi all,
I am using an open source menu that i found and it works great, except
for one thing that when the web page is not scrolled to the very top
the drop down links will not stay visible. Has...
|
by: oranoos3000 |
last post by:
hi
would you please help me
i have a online shopping center that i show pictures of the my product in home page.
in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
|
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: 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: 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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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: 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: 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,...
|
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...
| |