kobaatsu
6/26/2016 - 12:45 PM

http://qiita.com/kobaatsu/items/343df3f0b93bb9bfb821

runOnLoadImage = ($target)->
  d = new $.Deferred()
  loaded = 0
  max = $target.length
  $target.each ->
    targetObj = new Image()
    $(targetObj).on 'load', ->
      loaded++
      d.resolve() if loaded is max
    targetObj.src = this.src
  d.promise()