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");
            });

})

猜你喜欢

转载自www.cnblogs.com/weimingxin/p/8963624.html