0
我有一個jQuery的幻燈片,並內置了預加載功能:jQuery的預載荷無緩存在Chrome或Safari
function preload_images(){
var pre_image = curr_img - 1;
if(pre_image < 0) pre_image = (tot_elements-1);
var curr_obj = 0;
if(!$('#img_preloaded_'+pre_image).length > 0){
curr_obj = slideshow[pre_image];
$('.preload_left').append('<img src="'+curr_obj["img_url"]+'" id="img_preloaded_'+pre_image+'" class="preload_box" />');
}
var pre_image = curr_img + 1;
if(tot_elements==pre_image) pre_image = 0;
if(!$('#img_preloaded_'+pre_image).length > 0){
curr_obj = slideshow[pre_image];
$('.preload_right').append('<img src="'+curr_obj["img_url"]+'" id="img_preloaded_'+pre_image+'" class="preload_box" />');
}
一切都在Firefox的偉大工程 - 加載時的圖像緩存 - 但圖像不是出於某種原因緩存在Chrome或Safari中。您可以看到,在FF,Chrome和Safari中,圖像加載到幻燈片左側的文檔中,但它們不緩存。除FF之外,幻燈片將重新加載它們,因爲圖像已經緩存在FF中。
https://www.assembla.com/code/cfrepo/subversion/node/blob/trunk/index.html#image=CrossFire http://jsfiddle.net/doobada/9m9eq/
有什麼想法?