Glossy.js 1.4 allows you to add corners and shading and shadow to images on your webpages (alternatively: corner.js). 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 "glossy.js" and include it into your webpage.
To make it glossy just add a class="glossy" to the image (minimum dimension: 16x16).
Classes
Initialisation class "glossy"
vary the radius by adding iradius followed by the desired radius in percent
of half of the smaller picture dimension:
Corner radius class "iradius25" - min=20 max=50 default=25
vary the shadow by adding noshadow:
Noshadow class "noshadow" - default=false
vary the background by adding ibgcolor followed by the desired color as hex:
Background color class "ibgcolor" - min=000000 max=ffffff default=0
vary the background by adding igradient followed by the desired color as hex:
Gradient color class "igradient" - min=000000 max=ffffff default=0
vary the color gradient direction by adding horizontal:
Horizontal gradient class "horizontal" - default=false
If you want flexibility, use "cvi_glossy_lib.js" instead of "glossy.js".
You can make your images respond to user actions (e.g. changing one or more options when the image is hovered over).柔軟性を望む場合は、「glossy.js」の代わりに「cvi_glossy_lib.js」を使用してください。ユーザ・アクション(例えばイメージがとどまられる場合、1つ以上のオプションを変更して)にイメージを応答させることができます。
cvi_glossy.add(image, options); image should be an image element: document.getElementById("myimg") options can contain one or more values: {radius: value, shadow: value, shade: value, color: value, color2: value, gradient: value, noshadow: value, noradius: value}
Shows some of the things "glossy.js" does. 6 images with class = "glossy iradius50"
Empty gif with class = "glossy ibgcolor00aa00 igradient00aaaa horizontal noshadow"
3 images with class = "glossy"
Why use Javascript Image Glossy?
Fast and easy to implement. Just add class="glossy" to the image and your good to go.
Don't need to spend time in an image editor creating images with effects.
Works really well with forum avatars. Doesn't require additional server work.
It's dead easy to change the attributes of the images.
Free of charge use on non-commercial and private web sites.
In older browsers, the script degrades and your visitors won't notice a thing.
Restrictions
Opera do not support printing of canvas.
History
Version 1.4
Added scriptable lib version cvi_glossy_lib.js
Version 1.3
Added support for img attributes: id alt title src onclick
Version 1.2
Added soft shadows for IE
Version 1.1
Added support for Internet Explorer 6/7
Version 1.0
Initial Release
License
Glossy.js is distributed under this LICENSE. License permits free of charge use on non-commercial and private web sites only. There is also a Commercial Software License available.
Images used are copyrighted and are used for demonstration only.