Created
March 19, 2013 04:15
-
-
Save yusugomori/5193668 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var imgs = ['img_0.png', 'img_1.png', 'img_2.png']; // プリロードさせたい複数の画像 | |
| var dfds = []; | |
| for(var i=0; i<imgs.length; i++) { | |
| dfds.push( preload(imgs[i]) ); // dfds配列に dfd.promise() を格納 | |
| } | |
| $.when.apply(null, dfds).done(function(){ | |
| /* 画像読み込み完了後の処理 */ | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment