Skip to content

Commit 7bda9e2

Browse files
committed
First run at the jQuery cache Images plug-in
It’s caching, and the cacheImageFetchURL is working cacheImagesDrop is working
1 parent 1eaacea commit 7bda9e2

File tree

8 files changed

+9899
-8
lines changed

8 files changed

+9899
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
jQuery Cache Image plugin
2-
==================
3-
1+
#jQuery Cache Images plugin
2+
43
Plugin for jQuery that allows for the easy caching of image files in the browsers localstorage. The local storage approach allows the media to persist across sessions, while the browser manages all of the cross-domain privacy protections.
54

65
## Using the Plugin
76
The plugin can be used two ways. It can either be applied to a specific element in the DOM, or you can apply it to a container that will have images within it. Both approached will bind the Cache Image plugin to all future changes that occur to those elements or their children.
87

9-
### Attaching to an Element
8+
### Attaching to an Element
109
`$('img#AnElement').cacheImage();`
1110
Any selector here works, however it will bind to only existing elements. If you need to have the caching work on future dynamically created elements use the second approach.
1211

13-
### Attached to a Parent Container
12+
### Attached to a Parent Container
1413
`$('div#AwesomeContainer').cacheImage();`
1514
This will watch for changes to the parent and all child elements for changes that involve images. The plugin will step in, cache the image into local storage, and reveil the image to the user.
1615

17-
### Manually caching an image
16+
### Manually caching an image
1817
`cacheImageFetchURL('http://yourenota.plumber/wear-a-belt.png');`
1918
Attempts to cache that image into your clients browser local storage. This can be very helpful if you have an app where you are storying data into webSQL or IndexedDB and want to grab images during an initial sync, but those images might not be needed until later. By caching the images earily you ensure that they would be available along with the other data.
2019

@@ -34,7 +33,6 @@ cacheImageFetchURL('http://lookatmy.diamonds/mega-stone.jpg'); // Use to pre-ca
3433
cacheImageDisplay('http://lookatmy.diamonds/mega-stone.jpg'); // Use to insert the base64 encoded image string
3534
```
3635

37-
# Credits and Thanks
38-
36+
# Credits and Thanks
3937
* Based Heavily off of @doomhz plugin [jQueryImageCache](https://github.com/doomhz/jQuery-Image-Cache)
4038
* Utilizing base64 encoding from @mathias [Encoding XHR image data](http://jsperf.com/encoding-xhr-image-data/33)

assets/cat.gif

1.98 MB
Loading

assets/default.jpg

376 Bytes
Loading

0 commit comments

Comments
 (0)