Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: Re: loops in Javascript? - June 15, 1998 at 09:30:47

You are here: irt.org | BBS | Re: loops in Javascript? [This BBS is closed]

Posted by Keith on June 15, 1998 at 09:30:47:

In Reply to: loops in Javascript? posted by oscar susoy on June 15, 1998 at 04:52:35:

: the idea is to scroll the main frame when the mouseOver event occurs on the direction arrows.
: My idea was to place a loop between the mouseOver and mouseOut events that calls the scroll function of the main frame,
: but I can't seem to stop the the loop once I start it. Is it possible to have a loop in JS?

Your best bet is probably to start the scroll loop using something like this when you have a onMouseOver event:

id= setTimeout (scroll_function, delay);

and you'll need the same line _within_ the scroll function as well.

Upon detecting the onMouseOut event, use clearTimeout (id); to stop the scrolling.

regards, Keith

Follow-ups:

You are here: irt.org | BBS | Re: loops in Javascript? [This BBS is closed]

©2018 Martin Webb