misc/hats_js_anim.xhtml
changeset 15589 f22ebcd9f3fc
parent 15588 909ef1f3ef19
child 15590 de1b31c2d2f2
equal deleted inserted replaced
15588:909ef1f3ef19 15589:f22ebcd9f3fc
   305 function animateHogs()
   305 function animateHogs()
   306 {
   306 {
   307     var a = document.getElementsByTagName("a");
   307     var a = document.getElementsByTagName("a");
   308     for (var i=0;i<a.length;i++)
   308     for (var i=0;i<a.length;i++)
   309     {
   309     {
   310         if (a.className === "hat")
   310         if (a[i].className !== "hat")
   311             continue;
   311             continue;
   312         // Cycle through hedgehog and hat animation frames
   312         // Cycle through hedgehog and hat animation frames
   313 
   313 
   314         // Hedgehog
   314         // Hedgehog
   315         a[i].style.backgroundPosition=Math.floor(a[i].idle/16)*-32+"px "+(a[i].idle%16)*-32+"px";
   315         a[i].style.backgroundPosition=Math.floor(a[i].idle/16)*-32+"px "+(a[i].idle%16)*-32+"px";