polaroid.js

polaroid.js is a jQuery plugin that transforms any image into a polaroid photo.

Download polaroid.js v1.0.1

Documentation

Using polaroid.js couldn't be easier: just include the script and use some special attributes with any image you want to insert a polaroid frame. No need to call any script or initialize anything.

Usage

Step 1: include JQuery and polaroid.js in your page

<script src="jquery.js"/>
<script src="polaroid.js"/>

Step 2: every image you want to insert a polaroid frame just include the data-polaroid attribute

<image src="html5.png" data-polaroid/>

Options

Changing the color is easy: just use the data-polaroidcolor attribute. If not provided, the default color is white.

<image src="html5.png" data-polaroid data-polaroidcolor="#ff0000" />

You can choose to display or not the small piece of tape that holds the photo: use the data-polaroidtape attribute. If not provided, the default value is true (show tape).

<image src="html5.png" data-polaroid data-polaroidtape="false"/>

You can also control the shadow dimensions by using the data-polaroidshadow attribute. If not provided, the default value is 15.

<image src="html5.png" data-polaroid data-polaroidshadow="5"/>

JQuery API

polaroid.js is also a JQuery plugin which can be called from your code to transform any image. For instance, to insert a polaroid frame transform the image whoose id is my_image just issue the following JQuery command:

$('#my_image').polaroid({color: "#D500E0", tape: "true", shadow: 5})

More Examples

Images before polaroid
After polaroid

Cross Platform & Safe to Use with Older Browsers

Chrome Firefox Internet Explorer Opera Safari

polaroid.js allows developers to create fantastic looking images across all modern desktop and mobile browsers. polaroid.js uses HTML5 Canvas which is compatible with the latest Android and Apple iOS (iPhone/iPad) phones and tablets.

polaroid.js is a jQuery plugin.

List of supported browsers:

polaroid.js is safe to use with older browsers. If polaroid.js is not supported by the browser then the original image will be displayed as fallback and your site will continue to work. No javascript errors will be thrown.


Known Limitations

Due to javascript security reasons (same origin policy), polaroid.js will not work with images hosted on different domains. So you may have to host the images you modify.

License

You may use polaroid.js under the terms of the MIT License. More information.