You are here:   Home > Scripts > Javascript Image to Grayscale
What's
New
Doll
Makers
Room
Makers
Puzzle
Makers
Dress Up
Games
GirlSense - online dress up games for girls with fashion sense

Back to Scripts

Javascript Images Color / Grayscale (Desaturate)



Requires Internet Explorer 5.5 or later to work
The DIV is located below, before applying image filters the image object requires its layout to be set.
We do that by setting its height and width properties (done inside the style tag).
Having the layout defined can also be done by setting the position attribute to absolute.
Or the layout can be defined by setting the property CONTENTEDITABLE in the div.

To desaturate an image we set the grayScale property to 1.
Roll your mouse over the images below and they will turn from grayscale to color (onmouseover).
When your mouse exits the image (and/or text) the image will return back to gray (onmouseout).




DHTML Source



References:
MSDN - Basic Image, Grayscale




About     Privacy Policy     Hosting by Web Hosting Canada

Except where otherwise noted, this site is licensed under a Creative Commons License



contact us: elouai@gmail.com
©2003-2008 eLouai.com, All rights reserved