このコードを使用してdivを広げています:
$("#bar").animate({width: '50%'}, 3000);
$("#bar") div.
アドバイスをください、ありがとう!
このコードを使用してdivを広げています:
$("#bar").animate({width: '50%'}, 3000);
$("#bar") div.
アドバイスをください、ありがとう!
これがstep
オプションの使用目的です。ドキュメントを見てください:
http://api.jquery.com/animate/
$("#bar").animate({
width: '50%'
},
{
duration: 3000,
step: function(now, fx){
// update here, now is the current value
// something like this
$(this).text(Math.floor(now) + "%");
}
});
$('#bar').animate({width: '50%'}, {
duration: 3000,
step: function(now, fx) {
$('#bar_pct').text(now + '%');
}
});