1 $(function(){
 2      //添加判断图片是否存在操作
 3      var nopic="__CDN_PATH_1__/public/kn/Plan/images/base_plan.png";
 4      $("img").each(function(){
 5              var img = $(this);
 6              if(document.all && img.fileSize == -1){
 7                  $(this).attr("src", nopic);
 8              }else{
 9                 //头像不替换
10                 if($(img).width() > 110){
11                     $(img).error(function(){
12                         $(this).attr("src", nopic);
13                     });
14                 }
15              }
16          });
17  });

 

相关文章:

  • 2021-11-06
  • 2021-08-14
  • 2021-06-16
  • 2021-12-27
  • 2021-08-26
  • 2022-12-23
  • 2022-01-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2022-02-02
  • 2021-09-26
相关资源
相似解决方案