$(window).load(function(){
        loadImg();
    });
    function loadImg(){
        $(".m_shopContents").find("img").each(function(){
            var src = $(this).attr("data-src");
            if (src) {
                var img = new Image();
                img.src = src;
                var scope = this;
                img.onload = function(){
                    $(scope).attr({"src":this.src,"data-src":""});
                };
            }
        });
    }

 

posted on 2018-03-23 10:47  刘世涛6192  阅读(123)  评论(0编辑  收藏  举报