网络营销师_王健
js图片宽度自适应
post by:王健 2018-6-17 9:49

$(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中的图片
评论:
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容