|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
OnMouseOver & onMouseOut
I am using the onMouseOver and onMouseOut event handler to cause a picture to become visible when the mouse is over the target area, and then hidden when the mouse moves off the target area. It works perfectly EXCEPT when I move the mouse over the target area incredibly fast. At this high mouse movement speed sometimes the onMouseOut event is not triggered, and the picture stays visible when it should be hidden. I dropped a larger layer behind the target area with a duplicate onMouseOut event handler, and it helps, but I can still cause it to misbehave by moving the mouse REALLY INCREDIBLY fast. Anyone have any suggestions besides "Just don't move the mouse that fast!". I am going to code up some Javascript to force the image to a hidden state after a certain time interval has elapsed, but that may generate its own problems.
|
|
#2
|
|||
|
|||
|
RE: OnMouseOver & onMouseOut
Is this the way you code your script??? However, this worked fine.. I couldn't move my mouse away from the target area without hiding the image... I tried it faster than the fastest athlete! :laugh:
Code:
<html>
<head>
<title>Mouse Over/Out</title>
<script language="JavaScript">
function imgMouse(mouse)
{
var imgName='home.gif';
if(mouse=="down")
pic.innerHTML = "<img src='"+ imgName +"'>";
else
pic.innerHTML = "";
}
</script>
</head>
<body>
<div id="pic" style="position:absolute; width:88px; height:52px; z-index:5; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;" onMouseOver="imgMouse('down')" onMouseMove="imgMouse('down')" onMouseOut="imgMouse('up')">
</div>
</body>
</html>
|
|
#3
|
|||
|
|||
|
RE: OnMouseOver & onMouseOut
Many thanks your refreshingly simple example got me back on the right track. I was up to late last night making my code way to complicated by using excessive layering. I had to many layers hiding and showing each other, I deleted it all and now have only one layer that does what I needed...with one js function that calls some layer style options during the onMouseOver event handler.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > OnMouseOver & onMouseOut |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|