Curl.js 1.2 allows you to add individual curls (inc. backside mask) to images on your webpages. It uses unobtrusive javascript to keep your code clean.

It works in all the major browsers - Mozilla Firefox 1.5+, Opera 9+, Safari and IE6+. On older browsers, it'll degrade and your visitors won't notice a thing.

CVI-lab: Get a fast impression of the effects and their illustration qualities.

Setting Up

Download "curl.js" and include it into your webpage.

<script type="text/javascript" src="curl.js"></script>

Using It

To get the page curl effect just add a class="curl" to the image.

Classes

Demonstration

Shows some of the things "curl.js" does.

First Image with class = "curl invert", others with class = "curl isizeN" (different sizes)...

beautiful girl


Scripting Curls

If you want flexibility, use "cvi_curl_lib.js" instead of "curl.js". You can make your curls respond to user actions (e.g. changing the curl size when the image is hovered over).

Add image curl using Javascript
cvi_curl.add(image, options);
image should be an image element. options can contain a value for size, shadow, color or invert. The value for size and shadow should be between 0 and 100. The value for color should be between 0 and "#ffffff". The value for invert is boolean.
Examples:
cvi_curl.add(document.getElementById("myimg"), { shadow: 75, color: 0 }); cvi_curl.modify(document.getElementById("myimg"), { size: 50 });
Click to add or remove curl
1
Move over to in/decrease curl
2
Move over to change curl
3
Mouse up/down to change curl
4

Modify image curl using Javascript
cvi_curl.modify(image, options);
If the image has already a curl but the specified size or shadow or color or invert has changed, the curl will be changed accordingly.

Remove curl from an image using Javascript
cvi_curl.remove(image);

Set defaults using Javascript
cvi_curl.defaultSize = size;
cvi_curl.defaultShadow = shadow;
cvi_curl.defaultColor = color;
cvi_curl.defaultInvert = boolean;
Changes the default size and shadow and color. The default value for size is 33 and for shadow 66. The default value for color is 0. The default value for invert is false.

Why use Javascript Image Curls?

In older browsers, the script degrades and your visitors won't notice a thing.

History

Version 1.2 Version 1.0

License

Curl.js is distributed under this LICENSE. License permits free of charge use on non-commercial and private web sites only. There are also Commercial Software Licenses available.

Images used are copyrighted and are used for demonstration only.

cvi.netzgesta.de  also visit  CVI-lab, S5 Reloaded and AJAX-FilmDB