Je veux ajouter un nombre dans le nombre existant comme chronomètre, Ma fonction est d'ajouter le nombre parfaitement, mais je veux ajouter une animation comme chronomètre, j'ai essayé mais je n'ai pas eu la moindre idée de le faire. Voici un working demoComment ajouter un numéro avec animation
$('a').click(function() {
var val = parseInt($(this).text());
var currentVal = parseInt($('#price').text())
var cal = parseInt(val-currentVal)
var club = parseInt($('#price').text()) + cal
var bb = $('#price').text(club)
})
})
HTML
<a href="#">10000</a>
<a href="#">12000</a>
<a href="#">15000</a>
<div id="price">10000</div>
Pouvez-vous définir «animation comme un chronomètre»? Les chronomètres que j'ai vus n'ont pas d'animation, les valeurs apparaissent juste. –
Comme http://stackoverflow.com/questions/4424099/js-jquery-number-increasing-animation et http://stackoverflow.com/questions/5411343/how-to-animate-numbers-using-jquery? –
@RoryMcCrossan: s'il vous plaît voir ce http://thecodeplayer.com/walkthrough/make-a-stopwatch-using-css3-without-images-or-javascript, vous pouvez voir la valeur ajoutée – jchand