首页 > 技术文章 > Wex5循环某个div节点下的所有img标签,替换其src属性值

lxcmyf 2017-05-17 13:47 原文

Model.prototype.newsDetailAfterRefresh = function(event){
    var newsDiv = this.getElementByXid("newsContent");
    var imgArr = $(newsDiv).find("img");
    $.each(imgArr,function(index,o){
        var newImgSrc = "/baas/harbinMetro/homePage"+$(o).attr("src")+"&realFileName=IMG"+justep.UUID.createUUID()+"&operateType=preview";
        $(o).attr("src",newImgSrc);
    });
};

 

推荐阅读