By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,025 Members | 2,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,025 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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()".

Jul 20 '05 #2

P: n/a
> 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?
Jul 20 '05 #3

P: n/a
Lee
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>

Jul 20 '05 #4

P: n/a
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/>
--
Jim Dabell

Jul 20 '05 #5

P: n/a
Lee <RE**************@cox.net> wrote in message news:<bi*********@drn.newsguy.com>...
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.
Jul 20 '05 #6

P: n/a
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.

Jul 20 '05 #7

P: n/a
ez*****@pioneer-usa.com (Eqbal Z) wrote in message news:<3b**************************@posting.google. com>...
Lee <RE**************@cox.net> wrote in message news:<bi*********@drn.newsguy.com>...
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?
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.