<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>lazyload.js</title>
    <style type="text/css">
    </style>
  </head>
  <body>
    <img class="lazy" data-src="http://pic64.nipic.com/file/20150413/14041019_003715403000_2.jpg">
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/lazyload@2.0.0-beta.2/lazyload.js"></script>
    <script>
     $(function() {
        //data-src是高分辨率的,src是低分辨率的
        $('.lazy').lazyload({effect:'fadeIn'});
     });
    </script>
  </body>
</html>

相关文章:

  • 2022-12-23
  • 2021-07-20
  • 2021-06-15
  • 2021-11-27
  • 2021-11-30
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
相关资源
相似解决方案