jQueryでfadeOutとかのアニメーションして終わったらなんかするといったときにcallback関数を引数に指定するのとDeferred使う方法があるんだけどこの二つは挙動が違う。 こういうHTMLがあったとして <div>foo</div> <div>bar</div> <div>baz</div> まず以下のようなcallback関数の場合はそれぞれのfadeOutが終わるごとに呼ばれる。 $('div').fadeOut(function() { console.log('fin'); }); つまり'fin'が3回出力される。 一方Deferredを使った場合はこんな感じ。 $('div').fadeOut.promise().done(function() { console.log('fin'); }); .promise()がDeferredオブジェクトを返すので.do
Save a Beat For security reasons, web browsers don't make it easy to save files directly to your hard drive. But to save your beat just copy and paste the data block below into a text file. To load the beat later click the Load button then paste the data block from your text file into the blank window.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く