[Javascript] accessing event from setInterval function

Anthony Ettinger anthony at chovy.com
Wed Mar 7 15:17:01 CST 2007


here's the basic pattern:

onmouseover: setInterval where callback moves an element
onmousemove: constantly recalculate mouse current position and set a
new position for the element to be moved to.
onmouseout: destroy interval

I am trying to avoid recursively calling the setInterval when I
mouseover nested elements.




On 3/7/07, Julien Royer <eldebaran at gmail.com> wrote:
> setInterval has nothing to do with event handlers.
>
> Could you describe more precisely your need? Why do you need to access
> an event object from your function?
>
> On 3/7/07, Anthony Ettinger <anthony at chovy.com> wrote:
> > Is there a way to access the event object from within the setInterval
> > callback function?
> >
> > var myInterval = window.setInterval("doMyInterval();", 500);
> >
> > function doMyInterval ( e ) {
> >     //event object is not passed here....how can I gain access to it?
> >
> > }
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
>


-- 
Anthony Ettinger
Ph: 408-656-2473
http://chovy.dyndns.org/resume.html
http://utuxia.com/consulting



More information about the Javascript mailing list