js图片宽度自适应

$(function(){

 $("#d-intro").find("img").each(function () {
                $(this).removeAttr("width").removeAttr("height").removeAttr("style");
                //if ($(this).next("img").size() > 0) {//使照片之间有缝隙
                //    $(this).after("<br />");
                //}
               
                $(this).css({ "margin": "0", "padding": "0", "display": "block" });//解决两张图片之间的间隙
                $(this).css("width", "100%").parents().css("text-indent", "0em");
            });

 

})

走好选择的路,别选择好走的路
转自:https://www.cnblogs.com/weimingxin/p/8963624.html

设置好#d-intro对应位置的div,js来控制div中的图片