About This Script
To use this, simply copy the CSS from below to the <head> tag of your page. Then add the "highlight" class to any image you want this to apply to.
Demo
Hover over an image to see the effect.
Code
<style type="text/css">
/**
* Highlighting image effect provided by http://www.top-site-list.com
*/
img.highlight {
filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
opacity:.7;
-webkit-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
img.highlight:hover {
filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='matrix' values='1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0'/></filter></svg>#grayscale");
-webkit-filter: grayscale(0%);
opacity:1;
}
</style>
<!-- Examples. You don't need to copy this part. -->
<img class="highlight" src="http://www.top-site-list.com/scripts/assets/grayscale-images/dog.jpg" />
<img class="highlight" src="http://www.top-site-list.com/scripts/assets/grayscale-images/pizza3.jpg" />
<img class="highlight" src="http://www.top-site-list.com/scripts/assets/grayscale-images/sf.jpg" />
<img class="highlight" src="http://www.top-site-list.com/scripts/assets/grayscale-images/horse.jpg" />
More scripts