最近研究了京東商城用jQuery的實現如下
就是默認地址賦給img標簽的src
function lazyload(option) {
var settings = {
defObj: null
defHeight:
};
settings = $
var defHeight = settings
var defObj = (typeof settings
var pageTop = function() {
return document
};
var imgLoad = function() {
defObj
if ($(this)
var src
//已顯示的不用再顯示
if (src
//顯示後
$(this)
}
}
});
};
imgLoad();
$(window)
imgLoad();
});
}
lazyload({
defObj:"
});
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20483.html