<! DOCTYPEhtml>
<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/[email protected]/lazyload.js"></script>
<script>
$(function() {
//data-src is high resolution, SRC is low resolution
$('.lazy').lazyload({effect:'fadeIn'});
});
</script>
</body>
</html>
Copy the code
\