Image lazy loader
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

85 lines
12 KiB

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<meta charset="utf-8" />
<title>test page</title>
<style>
html,body,.container{
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
}
.main{
height: calc(100% - 41px);
background-color: #eee;
overflow-x: hidden;
overflow-y: auto;
}
.listTitle{
height: 40px;
line-height: 40px;
margin: 0;
font-size: 18px;
text-align: center;
border-bottom: 1px solid #007ACC;
}
.main{
list-style-type: none;
padding: 0;
margin: 0;
}
.item{
padding: 10px 0 10px 10px;
border-bottom: 1px solid #999;
}
.item>img{
float: left;
width: 50px;
height: 50px;
}
.item>p{
height: 50px;
line-height: 50px;
margin:0 0 0 60px;
}
</style>
</head>
<body>
<div class="container">
<p class="listTitle">Tlists</p>
<ul class="main">
<li class="item">
<img src="about:blank" data-echo="" alt="" />
<p>title and describe</p>
</li>
</ul>
</div>
<script src="../src/echo.js"></script>
<script>
var main=document.body.querySelector(".main"),
emptyImgBg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC",
picture=[
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAIBAQEBAQIBAQECAgICAgQDAgICAgUEBAMEBgUGBgYFBgYGBwkIBgcJBwYGCAsICQoKCgoKBggLDAsKDAkKCgr/2wBDAQICAgICAgUDAwUKBwYHCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgr/wAARCABLAEsDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtR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MYHJeO3AXkvpZ5JfceRupiTk5PfNUc/ajZ2zkk5NAzGq+BuyAFHX3BxJQcvzQ570RKe9DnvRzeSlp/qRUTUXC9V0bUTG/mub2o2rPhXWnXjWs6zIqMRxhhkU2PQifTrredqst4EluT7DWvJEgbOQR89v+6S0cnmmf8Ap0tWuPUWzvggY2Te6uWwFP2fvjPFJtUib8O9x4cFTUbjidhvVNf1MVNK9KtSi08SLLLMUbpYcqD/AD7/AB8/6r5okk80+/VW7jbY2p3dyjgPfKERR/HpK4yo/wAf0K+ep5VLsVyFzxnvigtCjzE4+PkEbqk+7fgnislehJmrcklDyPVGxilbVjKjlNQHvXTtmuaKAwkUrslbU4qVHqGsFYRlYx5arGzuFguY5nhjnVGDGOTPS/g4IOPwaaug+tcmjWC2lhsfbFqOj25HhgkV5F+ckuTzSdBNdgmg7FOKwMSDITGC7JEctOEyt4+o8u5LT9rLpllbWarlIbdSuDgjk5J+aXry5rqdiiKq4AKqTgeKEJP3XlarHA3ZjGAu1u/LMQXnJXbv5qF2zWmNc0YG4SuSUlZWVlZWyHX/2Q=="
],
html="",
index;
for(var cont=0;cont<3;cont++){
for(var i=0;i<10;i++){
index=~~(3*Math.random());
html+="<li class=\"item\"><img src=\""+emptyImgBg+"\" data-echo=\""+picture[index]+"\" alt=\"\" /><p>title and describe</p></li>";
}
}
main.innerHTML=html;
echo.init({
container:main
});
</script>
</body>
</html>