[thelist] juddering dhtml

Alastair Murdoch alastair at 19nine78.net
Sun Mar 3 15:36:00 CST 2002


>>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.

That's what I thought was happening. In the end I fixed it myself by pulling
apart another javascript and creating a control function.

function controlMove(){
if(!myID){
moveBart();
}
else{
window.clearTimeout(myID);
myID=0
}
}

and set myID = setTimeout(....

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

as for your suggestion, it never occured to me I could change variables
using events, so I've learned something anyway!!!

cheers

alastair




More information about the thelist mailing list