S
scottkim
Hey, I'm a relative newbie to javascript animation, any help woudl be
greatly appreciated.
I'm use setTimeout to do some animation... basic sequence of events:
function moveBalloon(div, xdiff, ydiff, evX) {
move_top = ydiff/10;
move_left = xdiff/10;
div.style.top = parseInt(div.style.top) + move_top;
div.style.left = parseInt(div.style.left) + move_left;
if(parseInt(div.style.left) < evX) {
the_timeout = setTimeout(moveBalloon(div, xdiff, ydiff, evX), 1000);
}
}
I know this code isn't optimized, but who cares... I'm just trying this
out.
When this runs, the div layer (aptly named div), just zooms over to the
new location properly without seeming to wait. I'm using this as part
of a firefox extension, would that be the problem?
Thanks,
Scott
greatly appreciated.
I'm use setTimeout to do some animation... basic sequence of events:
function moveBalloon(div, xdiff, ydiff, evX) {
move_top = ydiff/10;
move_left = xdiff/10;
div.style.top = parseInt(div.style.top) + move_top;
div.style.left = parseInt(div.style.left) + move_left;
if(parseInt(div.style.left) < evX) {
the_timeout = setTimeout(moveBalloon(div, xdiff, ydiff, evX), 1000);
}
}
I know this code isn't optimized, but who cares... I'm just trying this
out.
When this runs, the div layer (aptly named div), just zooms over to the
new location properly without seeming to wait. I'm using this as part
of a firefox extension, would that be the problem?
Thanks,
Scott