好吧,我抓获方法下从这个问题 best way to preload multiple images 我想落实到一个GET JSON数组我在预加载图像尝试
$.getJSON('/pageCall.php',{chapters:chapterNumber}, function(data)
{
chapter=data;
totalPages = chapter.length;
var options = '';
$.each(chapter, function(index, array) {
images[index] = new Image();
images[index].src = array['imageLocation'];
});
};
预加载图片,但是当我尝试并调用图像使用出现以下方法没什么
function callImage(ImageNo)
{
$('#mangaImage').attr('src', images[ImageNo]);
}