LoginSignup
1
1

More than 5 years have passed since last update.

waitをかけながらjQuery.each()の処理をやらせる

Posted at

意外と無いっぽいコードを置いとく。

    # each entries
    entries = objects
    $.each entries, ( i, entry ) ->
      setTimeout () ->
        console.log 'say '+i

      , 500*i

注意
- $.each()は勝手に処理して終わる
- setTimeoutが律儀に 500×i分のms待って順次処理する

$.each()のコールバックthis自体には.wait().delay()メソッドが居らっしゃらないので、こうなる。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1