469,360 Members | 1,807 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

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

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
7 3816
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
> 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
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
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
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
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
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.

Similar topics

2 posts views Thread by Peter David | last post: by
2 posts views Thread by Donald Firesmith | last post: by
1 post views Thread by Jeremy Holt | last post: by
18 posts views Thread by Tuckers | last post: by
1 post views Thread by JezB | last post: by
5 posts views Thread by Ryan Moore | last post: by
4 posts views Thread by marco | last post: by
3 posts views Thread by ajay2552 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.