-
Notifications
You must be signed in to change notification settings - Fork 7
/
demo.html
35 lines (27 loc) · 1.3 KB
/
demo.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jQuery Image Cache</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="assets/jquery-1.5.min.js"></script>
<script type="text/javascript" src="assets/jquery.imageCache.js"></script>
</head>
<body>
<h1>jQuery Image Cache plugin</h1>
<p>Images are kept in browser's Local Storage! But, sometimes they do a request to the server to check if the image is not updated when you keep the SRC attribute.</p>
<ul>
<li><img src="assets/test-image-1.jpg" class="imageCache" /></li>
<li><img src="assets/test-image-2.jpg" class="imageCache" /></li>
</ul>
<p>Images are kept in browser's Local Storage! No requests to the server are done because the image URL is not stored in the SRC attribute anymore but in data-src.</p>
<ul>
<li><img src="" data-src="assets/test-image-4.jpg" class="imageCache" /></li>
<li><img src="" data-src="assets/test-image-5.jpg" class="imageCache" /></li>
<li><img src="" data-src="assets/test-image-5.jpg" class="imageCache" /></li>
<li><img src="" data-src="assets/test-image-5.jpg" class="imageCache" /></li>
</ul>
<script type="text/javascript">
$('img.imageCache').imageCache();
</script>
</body>
</html>