...

View Full Version : cross browser (IE) animation problems



dudeamisgriff
08-06-2008, 08:55 PM
I'm attempting to move a div to the right, and at the same time create a frame of animation. It works fine in Firefox, but when I try it in IE it skips all the frames except the final one, creating a blinking frame every 35px (7 frames, interval = 5). How do I do this in IE?




function GoRight()
{
Frame = 0;
moveright = setInterval(right, speed);
}



function right(){
var Passable="t";
var testx=0;
var destx=x-interval;
for (testx=0; testx<15;testx++){
if (destx == NoRightx[testx] && y== NoRighty[testx])
{
var Passable="f";
break;
}
}
if (x>-1740 && Passable=="t"){
x=x-interval;
document.getElementById("map").style.left = x+'px';
Frame++
if (Frame == "7"){
Frame="0"
}
document.getElementById("player").innerHTML= "<img src=\"http://i184.photobucket.com/albums/x276/dudeamis/walktestright" + Walk[Frame] + ".gif\">";
}

}

function StopRight()
{
clearInterval(moveright);
document.getElementById("player").innerHTML= "<img src=\"graphics/walktestright01.gif\">";
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum