<!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>
转载于:https://www.cnblogs.com/xutongbao/p/9924923.html