testLazyLoad.html 2.15 KB
<!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>