i posted this on devshed forums but i figured i'd try here tooi'm building a menu that opens on click and closes when the mouse is moved out of the menu. the problem i'm having is that the onmouseout even seems to be triggered when it shouldn't. for example, the menu disappears when i move the cursor from Menu1 to Menu2example at http://65.185.91.185/scrilla/test.phphere's the html
<span onclick=toggle("trans_account_list");>Menu</span><br><br><div id="trans_account_list" style="display:none" onmouseout=setTimeout("toggle('trans_account_list');",500);> <div class="trans_account" onclick=window.location="trans.php?acct=1">Menu 1</div> <div class="trans_account" onclick=window.location="trans.php?acct=2">Menu 2</div></div>
function toggle(obj) { with (document.getElementById(obj).style) { display = (display == 'none') ? 'block' : 'none'; }}
#trans_account_list { position: relative; z-index: +1; border: 1px solid #000; font-size: 9pt; }div.trans_account { padding: 2 10; }div.trans_account:hover { background: #ccc; }
8/7/2005 11:12:03 AM
help plz
8/7/2005 6:05:58 PM
i have tried an few things, only thing left that i can think of to do is to write a conditional statement. can i borrow this script?
8/7/2005 7:04:59 PM
conditional statement for what?yeah you can use it, but it doesn't work see btw, mostly testing in firefox, but it doesn't work great in IE either[Edited on August 7, 2005 at 7:41 PM. Reason : :hover doesn't work at all in IE, but that's not the point]
8/7/2005 7:31:49 PM
well, i want to use it just to try some shit. make an 'if' statement so when on mouseout you have like 2 seconds until it touches another menu item or it goes anyway then, or something like that.
8/7/2005 7:34:44 PM
yeah i guess i could do something like that, i just was curious why it didn't workexample of the functionality i'm looking for at http://www.howtocreate.co.uk/tutorials/jsexamples/showhidedelay.htmlwhich works perfectly, so why doesn't mine
8/7/2005 7:42:37 PM
anybody else have any insight
8/8/2005 10:53:07 AM
don't you need to use the . operator in a with block stillapparently not, that's odd[Edited on August 8, 2005 at 11:01 AM. Reason : !]
8/8/2005 10:58:08 AM