我试图给一个 div 元素添加动画效果,并尝试使用从其他地方获取的某个值,我知道这个值是正确的,因为我已经输出了它... 所以我想知道为什么它不能正常工作?
animateBar(percentage.toFixed(2)+'%');
[ . . . ]
function animateBar(percentage)
{
$('#innerBox').animate({width: percentage}, 3000);
}