netscape 4.7: onmouseover not working when i put <a> tag within a div tag

E

Eqbal Z

Hi,

I have the following code, and onmouseover/onmouseout etc. does not
work in netscape 4.7.

<div id="divUpControl"><a href="javascript:void(0);"
onMouseOver="PerformScroll(-7);" onMouseOut="CeaseScroll();"
class="nounderline">[up]</a><a href="javascript:void(0);"
onMouseOver="PerformScroll(7);" onMouseOut="CeaseScroll();"
class="nounderline">[down]</a></div>


I have the style for the divs defined using javascript in the <head>
section of the page something like this:

var bAgent = window.navigator.userAgent;
var bAppName = window.navigator.appName;
if ((bAppName.indexOf("Netscape") >= 0) &&
(bAgent.indexOf("Mozilla/4") >= 0) && (bAgent.indexOf("Win") >= 0))
{
document.write ('<style type=text/css>')
document.write ('#divUpControl{position:absolute; width:200;
left:210; top:160; z-index:1; text-align: right}')
document.write ('</style>')

}

Any ideas on why this could be happenning? Code works fine for IE and
NS6 and higher.
 
L

Lee

Eqbal Z said:
Hi,

I have the following code, and onmouseover/onmouseout etc. does not
work in netscape 4.7.

<div id="divUpControl"><a href="javascript:void(0);"
onMouseOver="PerformScroll(-7);" onMouseOut="CeaseScroll();"
class="nounderline">[up]</a><a href="javascript:void(0);"
onMouseOver="PerformScroll(7);" onMouseOut="CeaseScroll();"
class="nounderline">[down]</a></div>


I have the style for the divs defined using javascript in the <head>
section of the page something like this:

var bAgent = window.navigator.userAgent;
var bAppName = window.navigator.appName;
if ((bAppName.indexOf("Netscape") >= 0) &&
(bAgent.indexOf("Mozilla/4") >= 0) && (bAgent.indexOf("Win") >= 0))
{
document.write ('<style type=text/css>')
document.write ('#divUpControl{position:absolute; width:200;
left:210; top:160; z-index:1; text-align: right}')
document.write ('</style>')

}

Any ideas on why this could be happenning? Code works fine for IE and
NS6 and higher.

In Netscape 4, The contents of an absolutely positioned DIV are
a separate Layer. Your event handlers aren't defined in that
Layer. Try "window.CeaseScroll()".
 
E

Eqbal Z

In Netscape 4, The contents of an absolutely positioned DIV are
a separate Layer. Your event handlers aren't defined in that
Layer. Try "window.CeaseScroll()".

The methods I am using (PerformScroll, CeaseScroll etc.) are defined
within the script tag in the <head> of the page. I tried
window.PerformScroll() and it did not work. Trouble is, it seems to me
that the mouseover event does not seem to work at all, even if I put
in onmouseover='alert("test");' it does not work. Any more ideas?
 
L

Lee

Eqbal Z said:
The methods I am using (PerformScroll, CeaseScroll etc.) are defined
within the script tag in the <head> of the page. I tried
window.PerformScroll() and it did not work. Trouble is, it seems to me
that the mouseover event does not seem to work at all, even if I put
in onmouseover='alert("test");' it does not work. Any more ideas?


The following works in Netscape 4 and Netscape 7.
I set the status line, rather than use alerts, because alert()
windows in onmouseover handlers are annoying to work with.

<html>
<head>
<style type=text/css>')
#divUpControl{position:absolute; width:200; left:210; top:160; z-index:1;
text-align: right}
</style>
</head>
<body>
<div id="divUpControl"><a href="javascript:void(0);"
onMouseOver="window.status='up';return true"
onMouseOut="window.status='out';return true"
class="nounderline">[up]</a><a href="javascript:void(0);"
onMouseOver="window.status='down';return true"
onMouseOut="window.status='out';return true"
class="nounderline">[down]</a></div>
</body>
</html>
 
E

Eqbal Z

Lee said:
Eqbal Z said:
The methods I am using (PerformScroll, CeaseScroll etc.) are defined
within the script tag in the <head> of the page. I tried
window.PerformScroll() and it did not work. Trouble is, it seems to me
that the mouseover event does not seem to work at all, even if I put
in onmouseover='alert("test");' it does not work. Any more ideas?


The following works in Netscape 4 and Netscape 7.
I set the status line, rather than use alerts, because alert()
windows in onmouseover handlers are annoying to work with.

<html>
<head>
<style type=text/css>')
#divUpControl{position:absolute; width:200; left:210; top:160; z-index:1;
text-align: right}
</style>
</head>
<body>
<div id="divUpControl"><a href="javascript:void(0);"
onMouseOver="window.status='up';return true"
onMouseOut="window.status='out';return true"
class="nounderline">[up]</a><a href="javascript:void(0);"
onMouseOver="window.status='down';return true"
onMouseOut="window.status='out';return true"
class="nounderline">[down]</a></div>
</body>
</html>

Its strange. If I cut and paste your code into a file and open in
netscape it works, but in my template for the site it doesn't!!! I am
not sure what I am doing wrong.
 
L

Lee

Jim Dabell said:
Lee wrote:

[snip]
The following works in Netscape 4 and Netscape 7.
I set the status line, rather than use alerts, because alert()
windows in onmouseover handlers are annoying to work with.

<html>
<head>
<style type=text/css>')
#divUpControl{position:absolute; width:200; left:210; top:160; z-index:1;
text-align: right}
[snip]

That will break in browsers that follow the CSS specification. The only
reason you have been able to get it to work is because you are putting
Netscape into "quirks mode", where it deliberately screws up rendering to
try and compensate for author errors. It's a much better idea, in my
opinion, to write correct code in the first place. Add a doctype, supply
units to go with your lengths, and validate your code to find other errors:

<URL:http://validator.w3.org/>

You might try reading the thread before responding.
I'm echoing back the OP's code, showing that it doesn't
display the problem he reports.
 
E

Eqbal Z

Lee said:
Eqbal Z said:
In Netscape 4, The contents of an absolutely positioned DIV are
a separate Layer. Your event handlers aren't defined in that
Layer. Try "window.CeaseScroll()".

The methods I am using (PerformScroll, CeaseScroll etc.) are defined
within the script tag in the <head> of the page. I tried
window.PerformScroll() and it did not work. Trouble is, it seems to me
that the mouseover event does not seem to work at all, even if I put
in onmouseover='alert("test");' it does not work. Any more ideas?


The following works in Netscape 4 and Netscape 7.
I set the status line, rather than use alerts, because alert()
windows in onmouseover handlers are annoying to work with.

<html>
<head>
<style type=text/css>')
#divUpControl{position:absolute; width:200; left:210; top:160; z-index:1;
text-align: right}
</style>
</head>
<body>
<div id="divUpControl"><a href="javascript:void(0);"
onMouseOver="window.status='up';return true"
onMouseOut="window.status='out';return true"
class="nounderline">[up]</a><a href="javascript:void(0);"
onMouseOver="window.status='down';return true"
onMouseOut="window.status='out';return true"
class="nounderline">[down]</a></div>
</body>
</html>

Its strange. If I cut and paste your code into a file and open in
netscape it works, but in my template for the site it doesn't!!! I am
not sure what I am doing wrong.

I noticed that if I put this code outside the <table> tags, it seems
to work, but within a table (<td>) tag it does not. Is there anyway to
make it work there?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top