Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > netscape 4.7: onmouseover not working when i put <a> tag within a div tag

Reply
Thread Tools

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

 
 
Eqbal Z
Guest
Posts: n/a
 
      08-23-2003
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.
 
Reply With Quote
 
 
 
 
Lee
Guest
Posts: n/a
 
      08-23-2003
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()".

 
Reply With Quote
 
 
 
 
Eqbal Z
Guest
Posts: n/a
 
      08-25-2003
> 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?
 
Reply With Quote
 
Lee
Guest
Posts: n/a
 
      08-25-2003
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>

 
Reply With Quote
 
Eqbal Z
Guest
Posts: n/a
 
      08-25-2003
Lee <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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.
 
Reply With Quote
 
Lee
Guest
Posts: n/a
 
      08-26-2003
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.

 
Reply With Quote
 
Eqbal Z
Guest
Posts: n/a
 
      08-27-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (Eqbal Z) wrote in message news:<(E-Mail Removed). com>...
> Lee <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> > 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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select text within a div tag by clicking on content of div tag or a button? visu Javascript 4 11-22-2006 06:25 AM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Onmouseover Event, Cursor property not working with Netscape or Firefox Jordan ASP .Net 1 06-10-2005 03:59 PM
Select text within a div tag by clicking on content of div tag? M Wells Javascript 0 10-06-2004 11:04 AM
Netscape 7 + div + position:fixed + onmouseover : bug ? Patrice Javascript 2 10-06-2003 02:26 PM



Advertisments