javascript animacje – fajne koniki

http://jsfiddle.net/twTab/3/

http://www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_46

http://jumpingfishes.com/dancingpurpleunicorns/

KOD 1 KONIKA:

<!DOCTYPE html PUBLIC „-//W3C//DTD XHTML 1.0 Transitional//EN” „http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;
<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<style>#animation img {
display: none;
}
#animation img:first-child {
display: block;
} </style>
<script>onload = function startAnimation() {
var frames = document.getElementById(„animation”).children;
var frameCount = frames.length;
var i = 0;
setInterval(function () {
frames[i % frameCount].style.display = „none”;
frames[++i % frameCount].style.display = „block”;
}, 100);
}
</script>
</head>

<body>
<div id=”animation”>
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging01.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging02.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging03.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging04.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging05.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging06.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging07.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging08.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging09.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging10.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging11.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging12.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging13.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging14.png&#8221; />
<img src=”http://jumpingfishes.com/dancingpurpleunicorns/charging15.png&#8221; />
</div>

</body>
</html>

Reklamy

Skomentuj

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

Logo WordPress.com

Komentujesz korzystając z konta WordPress.com. Wyloguj / Zmień )

Zdjęcie z Twittera

Komentujesz korzystając z konta Twitter. Wyloguj / Zmień )

Facebook photo

Komentujesz korzystając z konta Facebook. Wyloguj / Zmień )

Google+ photo

Komentujesz korzystając z konta Google+. Wyloguj / Zmień )

Connecting to %s