Menu
I’m trying to invoke setInterval to animate some CSS styles for a predefined number of frames. But I can’t get my different browsers to run setInterval correctly:
[code]Function animate(numFrames,speed){
var frame=0;
var intID=window.setInterval(“internal()”,speed);
function internal(){
if(frame==numFrames){
window.clearInterval(intID);
}else{
alert(frame);
frame++;
}
}
}
For some reason the format
[code]setInterval(“internal()”,speed);
doesn’t seem to work.
I’ve tried the following permutation
[code]setInterval(internal,speed);
which works in Firefox and Safari. What’s going on?