[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

MouseOut event not always registering in Netscape

Posted on 2001-06-13
13
Medium Priority
?
214 Views
Last Modified: 2008-02-07
Hi,

I have a number of <LAYERS> on a page, each has an onMouseOut event. However, if the mouse is moved quickly over a layer, it's onMouseOut event is not called. Is there a fix for this?

Thanks.
0
Comment
Question by:jonpers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
13 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 6188541
don't move your mouse so fast.

:-)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6188587
Post a link or the code please.

Cd&
0
 
LVL 10

Expert Comment

by:dij8
ID: 6188946
It could also be dependant on the speed of the computer.  If the mouse is moving over between cycles then it may not have time to register the event.

Also are therer any other events happening?  Like setTimeout events.
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 19

Expert Comment

by:DreamMaster
ID: 6190088
First a piece of advice...

onmouseover and onmouseout events are only working in IE (for layers)

Now to your problem....

There is no real fix for your problem, one thing is to make the layer a bit wider so you will for sure be over the layer...(but this could create problems with links of other layers that could fall underneath that layer...)

The problem is when you go over the layer really quickly....the place of the mouse is only calculated at certain time intervals, this is defined by your computers speed, there is no way for you to change it...it can happen that you moved sooo fast, that it doesn't detect the move properly.....

Max.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6190463
And of course the biggest problem you have is that you post a question and then ignore the responses that ask for more information.

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 6191191
>>There is no real fix for your problem


I'm sticking with my original answer....don't move the mouse so fast.

:-)

BRUNO
0
 
LVL 1

Author Comment

by:jonpers
ID: 6191920
I've made some progress - I think I know why it's happening but I'm having problems fixing it:

OnMouseOver in layer1 displays a layer(layer2) on top of layer1.
OnMouseOut in layer2 hides layer2.

The problem (I think) is that if you move the mouse fast over layer1 the onMouseOver event triggers, but layer2 has not been displayed by the time the mouse has exited.

JP.

P.S. COBOLdinosaur - I think you're being a bit premature with your criticism. I happened to be away from my desk for one afternoon and you're giving me grief! The reason I haven't put a code sample up is that the code I have is a lot more involved than what I've explained above and I didn't want to complicate matters.
0
 
LVL 1

Author Comment

by:jonpers
ID: 6192134
Here's a sample I put together to illustrate the problem. BTW, the problem occurs in IE using DIVs too.


<HTML>
<HEAD>
<script language="JavaScript">
function show(){
document.layers['lyr2'].visibility='show';
}
function hide(){
document.layers['lyr2'].visibility='hide';
}
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#800000" ALINK="#FF00FF" BACKGROUND="?">
<layer id="lyr1" visibility="show" z-index="1" bgcolor="blue" top="100" left="100" width="200" height="20" onmouseover="show();">Move mouse quickly</layer>
<layer id="lyr2" visibility="hide" z-index="2" bgcolor="red" top="100" left="100" width="200" height="20" onmouseout="hide();">Move mouse quickly</layer>
</BODY>
</HTML>

0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6192149
jonpers > There is first of all no need for the z-index property there....

By the way it is never wise to place two layers exactly on top of each other and then using the onmouseout even of the one on top of the other....

Especially in this case....

Since you have the onmouseover displaying the layer on top of it....the layer on top of it will never know you are actually (at that time) over him and will therefor not execute any events....

Can I ask why you want them to be exactly over each other?

Max.
0
 
LVL 1

Author Comment

by:jonpers
ID: 6192231
They're on top of each other because I can't change text color in a layer dynamically, like I can with a div.
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 300 total points
ID: 6192277
Ok....In that case I understand why you did it...

I'm afraid there is like I allready said...no real solution for this...as when it is about speed it all depends on the speed of the PC and tine Interval between reading coordinates...there's not much you can do...

One more question....how quick is quick with you? Like..."zip I'm off"? or more like "I'll just get off this link quickly now so I can see the link change color"??

You can always do it with a small delay....show lyr2 when you mouseover lyr1 and when you leave lyr1 do a settimeout for a second (maybe 2) and then let the link automatically get back to it's original layer...that might be a solution...

Max.
0
 
LVL 1

Author Comment

by:jonpers
ID: 6192300
Thanks for the advice Max. I actually got the problem fixed quite simply - I put the two layers into a parent layer and triggered both onMouseOver and onMouseOut from the parent layer.

By the way, I was a little confused by your comment earlier when you said that onMouseOver and onMouseOut only work in layers for IE. It's the complete opposite!

JP
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6192341
Ok....at that time I didn't know you used the layer tag....(I always refer to DIV's as layers) I never use the layer tag since the DIV tag works for both and I program around Netscape's shortcomings....in Netscape you cannot use onmouseover or onmouseout on DIV's...

Cheers,
Max.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question