Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-06-2008, 08:55 PM   PM User | #1
dudeamisgriff
New Coder

 
Join Date: Aug 2008
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
dudeamisgriff is an unknown quantity at this point
cross browser (IE) animation problems

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?

Code:
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\">";
}
dudeamisgriff is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:30 PM.


Advertisement
Log in to turn off these ads.