我試圖動畫某一位置之後的數字,但問題是,它在循環的條件一遍又一遍如何動畫數字與if語句的jQuery
我的JS
var target = $("#team").offset().top-$(window).height();
$(document).scroll(function() {
if ($(window).scrollTop() > target) {
$('#lines').animateNumber({ number: 165 },500);
}
});
我的HTML
<div id="team"></div>
<div class="col-lg-3">
<h3 id="lines">0</h3>
</div>
我要運行的語句之後的第一次,這就是它的
什麼功能是'animateNumber '? – void 2015-02-23 10:44:20