懒加载

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>无标题文档</title>
<style>
.box1{ width:100%;}
.box1 img{}
.content img{display:block;padding:6px;border:1px solid #999;}
.content img + img{margin-top:10px;}
</style>
</head>

<body>

 


<div class="example content">
<img src="img/grey.gif" data-original="img/bmw_m1_hood.jpg" width="765" height="574" alt="BMW M1 Hood">
<img src="img/grey.gif" data-original="img/bmw_m1_side.jpg" width="765" height="574" alt="BMW M1 Side">
<img src="img/grey.gif" data-original="img/viper_1.jpg" width="765" height="574" alt="Viper 1">
<img src="img/grey.gif" data-original="img/viper_corner.jpg" width="765" height="574" alt="Viper Corner">
<img src="img/grey.gif" data-original="img/bmw_m3_gt.jpg" width="765" height="574" alt="BMW M3 GT" />
<img src="img/grey.gif" data-original="img/corvette_pitstop.jpg" width="765" height="574" alt="Corvette Pitstop">
</div>

<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery.lazyload.min.js"></script>


<script>
$(function(){
$('img').lazyload({
effect:'fadeIn'
});
});
</script>

 

</body>
</html>

posted @ 2016-03-10 10:39  天--安静  阅读(112)  评论(0编辑  收藏  举报