testLazyLoad.html
2.15 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
<title>Title</title>
</head>
<body>
<style>
.yo-lazy {
height: 400px;
display: block;
}
</style>
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img1.png">
<div style="float:left">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img2.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img3.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img4.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img5.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img6.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img7.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img8.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img9.png">
<img class="yo-lazy" alt="loading" data-original="http://axuebin.com/lazyload/img/img10.png">
</div>
<!--<script src="jq.js"></script>-->
<!--<script src="jquery.lazyload.js"></script>-->
<!--<script src="jquery.scrollstop.js"></script>-->
<script src="../build/sdk.js"></script>
<script>
var lazyload = window.yo_sdk.lazyload;
var i = 4
function test (i){
var t = setTimeout(function () {
var node = document.createElement('img');
node.setAttribute('class', 'yo-lazy');
node.setAttribute('data-original', 'http://axuebin.com/lazyload/img/img10.png');
document.body.appendChild(node);
document.body.appendChild(node);
lazyload();
if (i) {
test(i);
} else {
return }
},2000);
}
while (i--) {
test (i)
}
//$("img").lazyload();
</script>
</body>
</html>