|
-
Jan 10th, 2002, 09:56 AM
#1
Thread Starter
Frenzied Member
image map problem in Netscape 6
could anyone look at the source of this and tell me why it dosent work for netscape 6? www.smallchichotels.com (click on Hotels & Resorts) . It worked for previous versions. This was built before I worked here and I'm not much of a netscape user or programmer.
thanks
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Jan 10th, 2002, 02:20 PM
#2
Thread Starter
Frenzied Member
I was either in a hurry or asleep or both...let me rephrase that question :)
this page is an image map of the world where the user clicks on a spot on the map and a list of towns pops up. in netscape 6 the user clicks and nothing happens. I think this may have something to do with divs vs layers. Like I said in the prev post, im not much of a netscape person but I am assuming that the layers are for use in netscape (4.7 and lower?).
thanks in advance
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Jan 11th, 2002, 04:25 AM
#3
Hyperactive Member
The problem is that the code is checking for a browser named nestacpe and using layersif it finds one! netscape 6 uses divs in the same way as IE apart from you use
docuemnt.getElemeniById('div_name').style.visibilty="hidden";
to access elemnts of the webpage.
so instead of doing the following to check for browser
Code:
if(navigator.appName == "Netscape"){
} else if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.indexOf("MSIE 4") != -1) {
}
use
Code:
if (document.layers){
//netscape 4 and below
//use layers
alert("netscape 4 and below");
} else if(document.all && !document.getElementById) {
//ie 3 and below
//use document.all and divs
alert("ie 3 and below");
}else if (document.getElementById){
//netscape 6
//ie 4 and above
//use divs and document.getElementById
alert("netscape 6 or ie 4+");
}else{
//****e browser go away!
alert ("go away");
}
now youll have to rewrite all those scripts....no wonder web development is so time consuming!
-
Jan 11th, 2002, 10:24 AM
#4
Thread Starter
Frenzied Member
thx 
I found that in a book last night and you (and the code w/its antiquated "if browser name=") confirmed it.
New problem:
who does netscape 6 deal with getting window size? This code segment never gets inside the blue if in NS6 so I was thinking maybe that was the problem.
Code:
if(document.getElementById){
eval("window.div" + varRegion + ".style.visibility = \"visible\"");
varMenuBottom = document.body.<%= BodyHeightProp %>Height - (eval("window.div" + varRegion + ".<%= BodyHeightProp %>Height") + eval("window.div" + varRegion + ".offsetTop"));
varMenuBottom = varMenuBottom.toString()
if(varMenuBottom.indexOf("-") >= 0){
if(document.body.<%= BodyHeightProp %>Height < eval("window.div" + varRegion + ".<%= BodyHeightProp %>Height")) {
eval("window.div" + varRegion + ".style.top = 0")
} else {
eval("window.div" + varRegion + ".style.top = var" + varRegion + "Top - varMenuBottom.replace(\"-\", \"\")")
}
}
} else {
hideMenus();
eval("document.layers.div" + varRegion + ".visibility=\"show\"");
varMenuBottom = (eval("window.innerHeight - (document.layers.div" + varRegion + ".clip.height + document.layers.div" + varRegion + ".top)"))
varMenuBottom = varMenuBottom.toString()
if(varMenuBottom.indexOf("-") >= 0){
if(eval("document.layers.div" + varRegion + ".clip.height") > window.innerHeight){
eval("document.layers.div" + varRegion + ".top = 0")
} else {
eval("document.layers.div" + varRegion + ".top = var" + varRegion + "Top - varMenuBottom.replace(\"-\", \"\")")
}
}
}
Thanks in advance,
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Jan 11th, 2002, 11:00 AM
#5
Hyperactive Member
hold on a minute, whats this
<%= BodyHeightProp %>
is it vbscript?? if so are you using asp?
-
Jan 11th, 2002, 11:59 AM
#6
Thread Starter
Frenzied Member
looks like that variable gets set at the top of the page
Code:
If Instr(1, Request.ServerVariables("HTTP_USER_AGENT"), "MSIE 5") = 0 Then
ShowFunctionType = "Click"
Else
ShowFunctionType = "MouseOver"
End If
If Instr(1, Request.ServerVariables("HTTP_USER_AGENT"), "MSIE") = 0 Then
BodyFunctionType = "Focus"
Else
BodyFunctionType = "MouseUp"
End If
If Instr(1, Request.ServerVariables("HTTP_USER_AGENT"), "Win") = 0 Then
BodyHeightProp = "scroll"
Else
BodyHeightProp = "offset"
End If
how would you suggest to fix this one? (yes, it has some asp ).
thanks
michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
-
Jan 11th, 2002, 12:21 PM
#7
Hyperactive Member
so
Code:
If Instr(1, Request.ServerVariables("HTTP_USER_AGENT"), "Win") = 0 Then
BodyHeightProp = "scroll"
Else
BodyHeightProp = "offset"
End If
when the above test is done BodyHeightProp is set to either
"scroll" or "offset"
I'm guessing that which ever one it's trying to use is the wrong one to use in netscape 6 (not being familiar with vbscript, I don't know what the above tests are doing).
type javascript: in the location bar to find out what error is occuring on that particular page(launches the javascript debugger).
You will also need to find out how netscape 6 finds the scrollbar position, or if indeed it can at all??
-
Jan 11th, 2002, 02:14 PM
#8
Thread Starter
Frenzied Member
thanks for all the help I posted a new post in the ASP forum reguarding that code chunk.
Michael
I'm off to GalahTech, hope to see you there.
If you don't like the rules they make, refuse to play their game. -- Steve Ignorant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|