-
Notifications
You must be signed in to change notification settings - Fork 7
/
README
23 lines (17 loc) · 863 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
jQuery Image Cache Plugin
Cache base64 encoded images in modern browser Local Storage with this jQuery plugin.
Set up get_image.php to return base64 encoded content from the server.
<ul>
<li><img src="assets/test-image-1.jpg" class="imageCache" /></li>
<li><img src="assets/test-image-2.jpg" class="imageCache" /></li>
<li><img src="assets/test-image-4.jpg" class="imageCache" /></li>
<li><img src="assets/test-image-5.jpg" class="imageCache" /></li>
</ul>
Or you can ommit the SRC attribute and store it in data-src, because some browseres still request the server to see if the image is not changed:
<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>
</ul>
<script type="text/javascript">
$('img.imageCache').imageCache();
</script>