[thelist] juddering dhtml

Richard Bennett richard.bennett at skynet.be
Sun Mar 3 14:34:00 CST 2002


Hi,
The problem is, the moveBart() function calls itself recursively using the
setTimeouts, so once it starts, it will continue to be called every "n"
milliseconds.
In your mouse events you call it again, so after a while the same function
is running many times.

One solution, is to set the "lIncrement" variable outside the moveBart()
function, so it is globally accessible, like this:

    lIncrement = 1

    function moveBart() {.....

And then just set this variable's value in the mouse events, like this:

    <a onmouseover="lIncrement=0" onmouseout="lIncrement=1" href="#">....


That should do it.

Cheers,
Richard.

----- Original Message -----
From: "Alastair Murdoch" <alastair at 19nine78.net>

I'm trying to make a dhtml scroller which will pause onmouseover and restart
on mouseout. It's also got to work on NS4, IE and NS6.

and I've ended up with:

http://www.19nine78.net/scroller.htm





More information about the thelist mailing list