Talk:Sneaky Bloons/@comment-28857013-20130902085044/@comment-28857013-20130922055815

Wow. that's a long code.

CSS Equivalent:

.sneak{ animation: sneak 2s alternate; -webkit-animation: sneak 2s alternate; @keyframes sneak { 0%  {opacity:0;} 100% {opacity:100;} }

JS Equivalent:

var sneake = document.getElementByClassName('sneak')[0]; //makes no sense in a game but whatever sneake.style.opacity = 0; var dir = 0; function sneak{ var sneaky = setInterval (trans,200); } function trans{ if (dir == 0){ sneake.style.opacity += 0.1; } else{ sneake.style.opacity -= 0.1; } check } function check { if (sneake.style.opacity == 1){ dir = 1; } else if(sneake.style.opacity == 0){ dir = 0; }

jQuery Equivalent (preset):

$(document).ready(function{ $(".sneak").fadeToggle(2000); $(".sneak").fadeToggle(2000); }); //(By far the most compact as jQuery already has fading command)

jQuery Equivalent (manual):

$(document).ready(function{ $("div").animate({opacity:'0'},"2000"); $("div").animate({opacity:'1'},"2000"); });