Hi VV,

Here's a neat little function to cludge a sleep in javascript:

/*
* This function will not return until (at least)
* the specified number of milliseconds have passed.
* It does a busy-wait loop.
* from http://www.faqts.com/knowledge_base/view.phtml/aid/1602/fid/53
*/

function pause(numberMillis) {
        var now = new Date();
        var exitTime = now.getTime() + numberMillis;
        while (true) {
        now = new Date();
                if (now.getTime() > exitTime)
                return;
        }
}

I experimented - with rather differing success - adding a pause(500) at the
tops of the buttonOrMenuMouseout and/or closeSubMenu functions in bjmenu.js.
I didn't find the results all that inspiring: it just made the page feel
really sluggish (esp. when moving between menus).

Other DHTML-style menus have waits before closing submenus but if you want
to stick with the accessible(ish)-CSS-based bjmenu a better solution might
be to increase the padding of the 'div.menu a.menuItem' entry in the
bjmenu.css. This will make the menus (visually) fatter but will allow a
little extra give in the mouse movement area.

Happy New Year, Farcriers!

Cheers

David
 
 


________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Willem Mulder (sent by Nabble.com)
Sent: Thursday, 5 January 2006 12:02 AM
To: [email protected]
Subject: [farcry-dev] Re: improved dropdown menus - brainjar flavor


Super thanx David :) 
and thankyou Jen for letting us know. 

P.S A little off topic but - David, do you have a simple solution for
delayed closure of submenus? I've tried using setTimeout various ways but
cannot get it to work. Seems like you can't pass a complex object (menu) as
a parameter in a function from the setTimeout call. Bit of a pain - but my
client's mouse slips off the menu and it's gone... be great if there was
half a second to recover :) 

Jen - can you forward this to David if you're in touch? 

Thanx again. 

VV 

________________________________

View this message in context: Re: improved dropdown menus - brainjar flavor
<http://www.nabble.com/improved-dropdown-menus---brainjar-flavor-t797603c621
.html#a2201522> 
Sent from the FarCry - Dev <http://www.nabble.com/FarCry---Dev-f633.html>
forum at Nabble.com. 

Reply via email to