$(".content img").each(function (index, el) { var oImgSrc = $(this).attr("src"); $(this).attr("src", "").attr("data-original", function () { return oImgSrc; }); //判断src是否为空,为空添加加载的loading背景图 if ($(this).attr("src").length == 0) { $(this).parent().css({ "background": "url(images/loading.gif) no-repeat center center", "background-size": "20px 20px" }); } else { $(this).parent().removeAttr("style"); }; });
对于富文本编辑器中使用lazyload图片懒加载
免责声明:文章转载自《对于富文本编辑器中使用lazyload图片懒加载》仅用于学习参考。如对内容有疑问,请及时联系本站处理。
上篇ubuntu16.04使用anaconda创建python虚拟环境Change of Variables Theorem 变量变换定理下篇
宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=