2011-03-25 76 views
0

我读过jQuery的加载方法不缓存的图像(重置src,使用.complete)的各种解决方法。但是我在实际执行下列live事件时遇到问题。缓存的图像仍然无法加载。在jquery活动事件处理程序中加载缓存的图像?

$('img.img-thumbs').live('click', function() { 
     $('#loader').fadeOut(500, function() { 
      $(this).empty(); 
      $(this).removeClass().addClass("loading visible"); 
      $(this).fadeIn(500);      
     });     
     var url = ($(this).attr('src')).replace("thumbs", "content"); 
     var _img = new Image(); 
     $(_img).one("load", function() { 
      $('#loader').fadeOut(500, function() { 
       $(this).removeClass().addClass("loaded visible fadeMe").append($(_img)); 
       $(this).fadeIn(500); 
      }); 
     }).attr('src', url); 
    }); 

感谢您的任何建议!

回答

0

不是一个真正的答案。但更改页面布局后问题消失。不要以为我会被困扰弄清楚为什么,就在现在。

相关问题