mui图片懒加载

Posted 娴娴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mui图片懒加载相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <title>懒加载</title>
        <link rel="stylesheet" href="../css/mui.min.css" />
    </head>
    <body>
        <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
            <h1 class="mui-title">lazyload(延迟加载) </h1>
        </header>
        <div class="mui-content">
            <ul id="list" class="mui-table-view mui-table-view-chevron">
                <li class="mui-table-view-cell mui-media">
                    <a class="mui-navigate-right"><img class="mui-media-object mui-pull-left" data-lazyload="http://p0.qhimgs4.com/t0191c0cf8fcaebea92.webp"><div class="mui-media-body">主标题<p class="mui-ellipsis">列表二级标题</p></div></a>
                </li>
            </ul>
        </div>
        <script type="text/javascript" src="../js/mui.min.js" ></script>
        <script type="text/javascript" src="../js/jquery-1.10.2.js" ></script>
        <script type="text/javascript" src="../js/mui.lazyload.js" ></script>
        <script type="text/javascript" src="../js/mui.lazyload.img.js" ></script>
        <script type="text/javascript">
            mui.init();
            (function($) {
                var list = document.getElementById("list");
                $(document).imageLazyload({
                    placeholder: ‘../img/defaultSmall.jpg‘,
                });
            })(mui);
        </script>
    </body>
</html>

 

以上是关于mui图片懒加载的主要内容,如果未能解决你的问题,请参考以下文章

编写代码实现图片懒加载

图片懒加载_intersectionObserver

设计模式(节流模式-----图片懒加载)

原生js实现图片列表懒加载和截流

实现图片懒加载(及优化相关)

实现图片懒加载(及优化相关)