Created
October 27, 2016 08:46
-
-
Save Scretch-1/8b92dcb4af7ed133eefe94b744682828 to your computer and use it in GitHub Desktop.
JS скрипт плавного увеличения чисел
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Источник http://codepen.io/shivasurya/pen/FatiB --> | |
<!-- //-- В файл HTML --// --> | |
<div><span class="count">200</span></div> | |
<div><span class="count">1000</span></div> | |
<div><span class="count">853</span></div> | |
<div><span class="count">154</span></div> | |
<div><span class="count">10</span></div> | |
<div><span class="count">87</span></div> | |
<!-- //-- В файл common.js --// --> | |
$('.count').each(function () { | |
$(this).prop('Counter',0).animate({ | |
Counter: $(this).text() | |
}, { | |
duration: 4000, | |
easing: 'swing', | |
step: function (now) { | |
$(this).text(Math.ceil(now)); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment