画像のプリロード

JavaScript


(function () {
    function preloadImages(images) {
        var objects = [];

        if (Array.prototype.forEach) {
            images.forEach(function (image) {
                var imgObj = new Image();
                imgObj.src = image;
                objects.push(imgObj);
            });
        }
    }

    preloadImages([
        "/images/btn_kv_start.png",
    ]);
}());