onmouseout event firing wrong with layers & interactive buttons?

R

Rob Ainscough

I have a layer that contains 2 interactive buttons (glow rectangle 7) -- set to hidden is the default. I have a mouseover on another button on my page that will make the Layer visible when a mouseover happens. So far so good. However I have a onmouseout event set on the Layer containing my two buttons to set itself (layer) to hidden. I have NO onmouseout events set for either button in this layer. However, when I move the mouse of the second button in my layer it will hidden the layer (triggering the onMouseOut event for the layer -- but the mouse is still within the layer boundaries

Any suggestions are to what might be going on

Thanks, Rob.
 
S

Stefan B Rusynko

Easier to see / understand what is triggering what if you provide a URL of a page w/ the layers




| I have a layer that contains 2 interactive buttons (glow rectangle 7) -- set to hidden is the default. I have a mouseover on
another button on my page that will make the Layer visible when a mouseover happens. So far so good. However I have a onmouseout
event set on the Layer containing my two buttons to set itself (layer) to hidden. I have NO onmouseout events set for either button
in this layer. However, when I move the mouse of the second button in my layer it will hidden the layer (triggering the onMouseOut
event for the layer -- but the mouse is still within the layer boundaries.
|
| Any suggestions are to what might be going on?
|
| Thanks, Rob.
 
J

Jon Spivey

I think we can figure this out without seeing it. One should never apply a
mouseout event to a layer - the reason is the mouseout event will fire every
time you mouseout of anything within the layer (the buttons in this case)
not just when your mouse leaves the mouse leaves the layer. For example

<div onmouseout="alert('mouseout');" style="......>
<p>text</p>
<p>more text</p>
</div>

Notice the alert pops up when you mouseout of the <p> tags even though your
mouse is still within the layer. There's 2 answers to this - stick another
layer behind the layer you want to hide containing a transparent gif and
apply the hide layer behavior to the image, re
http://www.roksteady.net/menus/
Or for a script solution without needing an extra layer (more difficult)
http://myweb.tiscali.co.uk/jonspivey/mouseout.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top