473,748 Members | 10,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem to show a div on Netscape

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.a ll && !document.getEl ementById)? true:false
var ie5=(document.a ll && document.getEle mentById)? true:false
var n4=(document.la yers)? true:false
var n6=(!document.a ll && document.getEle mentById)? true:false

// creation of three div

var links=3;
var floatinglinks=n ew 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.visibili ty="hidden";
}

else if(n4)
{

document.layers[floatinglinks[i]].visibility="hi de";
}

else if(n6)
{

document.getEle mentById[floatinglinks[i]].style.visibili ty="hidden";
}
}

// showing the div thanks to "number"

if(ie4||ie5)

{
document.all[floatinglinks[number]].style.visibili ty="visible";
}

if(n4)
{
document.layers[floatinglinks[number]].visibility="sh ow";
}

if(n6)
{
document.getEle mentById[floatinglinks[number]].style.visibili ty="visible";
}

}

</script>

*************** **** end of the script********* *************
Then in the body:

Access to the function in the menu with "onclick"

<td>&nbsp;<im g src="images/bouton_off.jpg" id="bouton_1" alt="flats"
title="flats"/>&nbsp;<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.getEle mentById[floatinglinks[i]] has no properties

What should i change in the script or in the body ?

Thanks for your answers !
Telemak.
Jul 23 '05 #1
6 1393
I haven't looked at your code at all, except to note that
you have two different capitalizations for Flats/flats.
var floatinglinks=n ew 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
Jul 23 '05 #2


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!
Jul 23 '05 #3


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!
Jul 23 '05 #4
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.getEle mentById[floatinglinks[number]].style.visibili ty="visible";
^ ^
document.getEle mentById(floati nglinks[number]).style.visibil ity="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

Jul 23 '05 #5
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.f r> 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!

Jul 23 '05 #6
mscir <ms***@access4l ess.com.net.org .uk> wrote in message news:<10******* ******@corp.sup ernews.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.getEle mentById[floatinglinks[number]].style.visibili ty="visible";
^ ^
document.getEle mentById(floati nglinks[number]).style.visibil ity="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

Jul 23 '05 #7

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

Similar topics

1
2810
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
1865
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. Click on it again and they disappear. This works great in IE6 but doesn't seem to work in Netscape 7. I have included the main javascript code below, along with a sample of the Menu code. What (if anything) do I need to tweak to get this to...
2
1470
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 swithced it to "javascript:show(...);" and the code works, but I read in this group that it was not wise to do that, here's the working version, using the not recommended approach: <a href="javascript:show('art_2.jpg','600','448');" target="_self">...
2
1749
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 exactly what I entered in the link dialog: <a href="javascript:popImage('http://www.sambuccibros.com/carseat.jpg','New Car Seat')"> Is this my problem? Please help.
9
1243
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
2
1370
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 login functions, I have to check the user ID and the password for invalid data. It works well in IExplorer, but it doesn't show the validation summary (displayed in a Javascript alert box) in Netscape. This is what I have in the asp page: ...
10
1840
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 hitting the site. The other two applications are running on my personal server which has Windows 2003, IIS 6, and .Net 1.1 Most of my users can use the sites. Two have come up with a very strange problem. They try to go to either application and...
1
2070
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 anyone else had this sort of problem with javascript? and any ideas how to fix it would be greatly appreciated.. I have included a copy of the code below, thanks. /**
1
3810
oranoos3000
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 properties alt in img tag istead of picture . place of the pictures is saved in the database(my database is with mysql) and in home page i fetch properties of the product and address of place that pictures is located output of the code in the...
0
8991
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
8831
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9374
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
9249
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...
1
6796
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
6076
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
4607
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...
1
3315
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
2787
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.