progress()

このエントリーをはてなブックマークに追加

Animation.progress()はアニメーションの途中経過中でコールバック関数を実行できます。

このメソッドは$.Animation()で作成されたアニメーションオブジェクトに対して実行できます。

var anim = $.Animation($("div").get(0),{
    left:400
},{
    duration:10000
});
anim.progress(function(){
	console.log("ok")
});

sample

Anime.progress()は3つの引数をとり、第1引数にアニメーションオブジェクト、第2引数にアニメーションの進行状況を0-1の数値で、第3引数に現在の経過時間をミリ秒で取得できます。

anim.progress(function(anim,progress,ms){
	console.log(anim);//アニメーションオブジェクト
	console.log(progress);//アニメーションの進行状況(0-1)
	console.log(ms);//現在の経過時間
});
jQuery 1.8.0での追加/変更

Animation.progress()はjQuery1.8.0で追加されたメソッドです。

参考URL

Draft documentation for jQuery 1.8 Effects. Please contribute comments. — Gist

登録日 : 2012年11月18日 最終更新日 : 2012年11月18日

同じカテゴリー(Animation)のエントリー

検索

スポンサードリンク

バージョン

リファレンス