setTimeOut exec the action with certain delay,
use instead Date object to set a waiting time to exec the action:


here your solution, may not work propertly but, you get the idea:
----

var onOverTime, oldOverTime = 0    // time on mouse over
var actionTime = 3                      // seconds to wait before the action
is executed
var isOver                   // true if the mouse is over, false if is out

function onMouseOver(){
    isOver = true
    onOverTime = date.getTime();
    setTimeOut( 'execAction()', actionTime )
}

function onMouseOut(){
  isOver = false
}

function execAction(){
    if( !isOver )   // if mouse is not over, don't exec the function
       return;

    var date = new Date();
    onOverTime = date.getTime();
    if( oldOverTime && ( onOverTime - oldOverTime > actionTime ) ){
        // exec what you want
        oldOverTime = 0;
    }
    oldOverTime = onOverTime;
}
----

Bye
Federico
www.raintpl.com



2010/7/26 Rossko <[email protected]>

> > Can this be done and how (if possible)?
>
> Use setTimeout.
> The trick is to reset a timer upon mouseout event occuring inside your
> 'settling time', so that the timeout never expires to triggers the
> infowindow.
>
> http://www.akxl.net/labs/articles/handling-events-in-javascript---from-basics-to-best-practices/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to