Как сделать рост чисел?
$('#num').animate({ num: 90 - 3/* - начало */ }, { duration: 5000, step: function (num){ this.innerHTML = (num + 3).toFixed(2) + '%' } }); <div id="num"></div> Подскажите пожалуйста как сделать чтобы было стартовое число 2450 и к нему вечно просто добавлялось +2 |
dima-kruglyak,
setTimeout |
dima-kruglyak,
<!DOCTYPE HTML> <html> <head> <title>Untitled</title> <meta charset="utf-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script> $(function(){ var n = 2450, d = $("#num"); (function fn() { d.text(n); n+=2 window.setTimeout(fn, 5000) })(); }) </script> </head> <body> <div id="num"></div> </body> </html> |
Часовой пояс GMT +3, время: 02:47. |