$('.progress-bars li').each(function(i){
var percent = $(this).find('.spann').attr('data-width');
var $endNum = parseInt($(this).find('.spann strong i').text());
var $that = $(this);
$(this).find('.spann').animate({
'width' : percent + '%'
},1600, function(){
});
$(this).find('.spann strong').animate({
'opacity' : 1
},1400);
$(this).find('.spann strong i').countTo({
from: 0,
to: $endNum,
speed: 1200,
refreshInterval: 30,
onComplete: function(){}
});
if(percent == '100'){
$that.find('.spann strong').addClass('full');
}
});
我用标签找到号码countTo功能。我的问题是我想在运行countTo脚本后删除这些标签。
例子:
后,我跑我想删除标签和保持数量的脚本。
+0
为什么不使用更多语义的东西而不用担心删除它们?或者将它们包含在'data-'属性中? –
2015-02-08 12:37:36
+0
因为我使用一页滚动,当我切换当前页面时,它再次开始countTo。 我尝试了很多东西,但这是我最好的解决方案。 –
2015-02-08 12:48:56