3kb native video pictures lazy loading

A plug-in for lazy loading of videos and pictures, 3kb lightweight

usage:

Imported through cdn:

<script src="http://aerwen.net:8888/cdn/lazyload.min.js"></script>

Download by: http://aerwen.net:8888/cdn/lazyload.min.js, right click and save as

usage:

<img lazyload="http://localhost:666/images/1.png" class="img-item" alt="">
<video lazyload="http://localhost:666/video/1.mp4" class="img-item" controls></video>
createLazyLoad({        //这里第一个可以填根节点,不填默认为document
    payload:1,                //加载区域
    error:'error.png',        //加载错误占位图
    loading:'loading.gif',        //加载中占位图
})

Please see the specific documentation:lazyload-hyw - npm (npmjs.com)

Guess you like

Origin blog.csdn.net/m0_62398656/article/details/128304624