其他分享
首页 > 其他分享> > 24HUI - 图片懒加载(hui-lazy)

24HUI - 图片懒加载(hui-lazy)

作者:互联网

效果图

在这里插入图片描述

示例代码

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>HUI</title>
<link rel="stylesheet" type="text/css" href="../css/hui.css" />
</head>
<body>
<header class="hui-header">
    <div id="hui-back"></div>
    <h1>HUI </h1>
</header>
<div class="hui-wrap">
    <div class="hui-common-title" style="margin-top:15px;">
        <div class="hui-common-title-line"></div>
        <div class="hui-common-title-txt">懒加载演示</div>
        <div class="hui-common-title-line"></div>
    </div>
    <style>
    #list2 li{width:50%; float:left; margin:5px 0px;}
    #list2 .hui-img-list-content{padding:5px; padding-bottom:10px;}
    #list2 h1{font-size:14px;}
    </style>
    <div class="hui-img-list" id="list2">
        <ul>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/1.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/2.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/3.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/4.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/1.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/2.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/3.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/4.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/1.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/2.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/3.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
            <li>
                <a href="javascript:hui.toast('hi...');">
                    <img lazySrc="../img/imglist/4.jpg" src="../img/lazy.png" class="hui-lazy" />
                    <div class="hui-img-list-content">
                        <h1>标题内容....</h1>
                        <p>power by hcoder.net</p>
                    </div>
                </a>
            </li>
        </ul>
    </div>
    <div style="height:50px;"></div>
</div>
<script src="../js/hui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
hui.lazyLoad();
</script>
</body>
</html>

标签:lazy,power,hcoder,....,hui,标题,24HUI,内容,net
来源: https://blog.csdn.net/qq_20042935/article/details/89338065