misc/hats_js_anim.xhtml
changeset 15567 f22ebcd9f3fc
parent 15566 909ef1f3ef19
child 15568 de1b31c2d2f2
equal deleted inserted replaced
15566:909ef1f3ef19 15567: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";