forked from sebarmeli/JAIL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample8_callback.html
44 lines (41 loc) · 1.64 KB
/
example8_callback.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>jQuery Asynch Image Loader - Example 8 - Test for callbacks</title>
<script type="text/javascript" src="../lib/jquery.js"></script>
<script type="text/javascript" src="../src/jail.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('img.lazy').jail({
callbackAfterEachImage : function() {alert("one image is loaded");},
callback : (function(){alert("All the images are loaded");})
});
});
</script>
</head>
<body>
<div id="wrapper">
<div class="content">
<p> Images visible in the viewport loaded after DOM is ready + callbackAfterEachImage parameter + callback parameter</p>
<div>
<img class="lazy" data-src="img/sample1.jpg" src="img/blank.gif" width="420" height="320"/>
<noscript><img class="nolazy" src="img/sample1.jpg" width="420" height="320"/></noscript>
</div>
<div>
<img class="lazy" data-src="img/sample2.jpg" src="img/blank.gif" width="420" height="320"/>
<noscript><img class="nolazy" src="img/sample2.jpg" width="420" height="320"/></noscript>
</div>
<div>
<img class="lazy" data-src="img/sample3.jpg" src="img/blank.gif" width="420" height="320"/>
<noscript><img class="nolazy" src="img/sample3.jpg" width="420" height="320"/></noscript>
</div>
<div>
<img class="lazy" data-src="img/sample5.jpg" src="img/blank.gif" width="420" height="320"/>
<noscript><img class="nolazy" src="img/sample5.jpg" width="420" height="320"/></noscript>
</div>
</div>
</div>
</body>
</html>