A
A
Alexander Osadchy2019-12-08 14:57:13
PHP
Alexander Osadchy, 2019-12-08 14:57:13

How to make animation of numbers?

I need to animate the numbers.

Below I gave two examples, the first one is working (for one digit), and the second one is not - for each digit, that's what I need.


+ Can you leave hundredths somehow?
So that it is not 513, but 513.60, etc.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rikonardo, 2019-01-07
@REKTOR_RG

I'm not strong in PHP, so maybe I'm not working with variables correctly. (Worked with PHP only on uCoz).

<head>
<?if($b_name == "opera.png")?>
<meta http-equiv="refresh" content="1;URL=http://www.mysite.com/opera" />
<?endif?>
</head>

0
0xD34F, 2019-12-08
@DELUX

$('.num').each(function() {
  $({ value: 0 }).animate({ value: +$(this).text() }, {
    duration: 1000,
    easing: 'linear',
    step: val => $(this).text(val.toFixed(2)),
  });
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question