Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with mouseovers on divs.

Status
Not open for further replies.

SetoKaiba

Programmer
Jun 16, 2004
28
US
I'm trying to get this code to work, basically there is a div with code:

<div id="diva" style="position:relative; height:69; width:238; top:-444; left:-229; visibility:hidden; filter:alpha(opacity=90);">
<a onmouseout="hidediva()">
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td><a href=".php" onmouseover="document.pimga.src='flyout/pres_hi.jpg';forceovera()" onmouseout="document.pimga.src='flyout/pres.jpg'"><img src="flyout/pres.jpg" name="pimga" border=0></a></td></tr>
<tr><td><a href=".php" onmouseover="document.pimgb.src='flyout/overview_hi.jpg';forceovera()" onmouseout="document.pimgb.src='flyout/overview.jpg'"><img src="flyout/overview.jpg" name="pimgb" border=0></a></td></tr>
<tr><td><a href=".php" onmouseover="document.pimgc.src='flyout/obj_hi.jpg';forceovera()" onmouseout="document.pimgc.src='flyout/obj.jpg'"><img src="flyout/obj.jpg" name="pimgc" border=0></a></td></tr>
</table>
</a>
</div>

The hidediva(); function is supposed to set this div (which looks like a DHTML Menu flyout) to go back to being hidden, however when I run the mouseover INSIDE the div, it will disappear when I move to a different image in the div. Is there a way to prevent this?
 
have you tried moving the onmouseout call from the <a> to the <div> instead?


=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Yeah, that was my first idea, but the div is transparent slightly, and I am not sure if that would have bearing on it. With the div, its whereever I move it, it kills it. Also I need it killed when it moves away from the image and not to the div. If there was a function that checks to see if the mouse is over something, that'd help dramatically.
 

>> If there was a function that checks to see if the mouse is over something, that'd help dramatically.

You can use the "onmouseover" event on the image to stop the DIV hiding - maybe hide the DIV on a timer, and clear that timer if the mouse moves onto the image?

Hope this helps,
Dan
 
Yeah, I actually made a series of functions that instead of calling the hidediv function right away, it cleared it in 5 milliseconds, and should a mouseover happen, which logically happens instantly if you move to another link of the pullout menu, it clears that timer. It works pretty much flawlessly now, and is the first Drop down menu I've ever personally coded. Thanks for your help though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top