<img id="img3" src="" data-src="/home/SeeImg?file=3032b808396a28022d760c464241c194.jpg" style="height:100px;min-width: 32px" />
!function (w) {
w.addEventListener('scroll', function () {
watchImgShow();
});
w.watchImgShow = function () {
var clientHeight = document.documentElement.clientHeight;
var scrollTop = document.documentElement.scrollTop;
var scrollHeight = clientHeight + scrollTop;
$("img[src='']").each(function (index, ele) {
var dom_offsetTop = $(ele).offset().top;
if (scrollHeight >= dom_offsetTop) {
console.log(ele);
console.log("scrollHeight=" + scrollHeight + ",dom_offsetTop=" + dom_offsetTop);
$(ele).attr("src", $(ele).attr("data-src"));
setTimeout(function (g) {
$(g).css("max-height", "100px");
$(g).css("height", "");
}, 100, ele);
}
});
}
watchImgShow();
}(window);
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39