by shigemk2

当面は技術的なことしか書かない

animateの処理を実行中に関数を呼び出す

animate(params, options) - jQuery 日本語リファレンス

stepを使う。書き方はこんな感じ。

$("#animate").click(function(){
  $(".block").animate(
    {width: "toggle", opacity: "toggle"},
    {duration: "slow", easing: "linear",
     complete: function(){alert("completed!");}, // 実行後に呼び出される
     step: function(s){$("#steps").text(s)} // 実行中のフレーム毎に呼び出される
    }
  );
});