Nová ukázka
Reset
Načíst z URL
Uložit a získat odkaz
Vztahuje se k…
Nevyplňujte
Napiště „nejsem robot“
▶
Přepnout zobrazení
Výsledek
<div class="ticker"> 10 </div> <div class="ticker"> 100 </div> <div class="ticker"> 27 </div> <div class="ticker"> 42 </div> <div class="ticker"> 13 </div>
HTML
Autoformát
Standardní režim
Mobilní zobrazení
CSS
Autoformát
CSS reset
Až na konci
function countdown(element) { var remaining = element.text(); var timer = setInterval(function() { remaining--; if(remaining >= 0) { element.text(remaining); } else { clearInterval(timer); } }, 1000); } function countdowns(selector) { $(selector).each(function(x) { countdown($(this)); }); } $(document).ready(function() { countdowns(".ticker"); });
J
ava
S
cript
Autoformát
jQuery
Umístění JS
window.onload
</head>
</body>