Last active
December 17, 2015 15:19
-
-
Save ginpei/5630522 to your computer and use it in GitHub Desktop.
This file contains 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
// 注意: 動かしてない、想像で書いてるコードです。 | |
// "_off"を含む画像ファイルを検索 | |
$('img[src~=_off]').each(function (index, elem) { | |
// 画像URL取得 | |
var offSrc = elem.src; | |
// _onな画像URLを生成 | |
var onSrc = offSrc.replace('_off', '_on'); | |
// _onな画像を先行み込み | |
new Image().src = onSrc; // どこかに保存しておかないと、GCに回収されて読み込まれないんだっけ? | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment