Created
April 18, 2013 20:59
-
-
Save papucho/5416172 to your computer and use it in GitHub Desktop.
Grayscale filter using SVG+CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="http://lorempixel.com/400/200/sports/" alt="" class="fader"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img.fader { | |
filter: url(filter.svg#grayscale); /* Firefox 3.5+ */ | |
filter: gray; /* IE6-9 */ | |
-webkit-filter: grayscale(1); /* Google Chrome & Safari 6+ */ | |
-webkit-transition: all 2s; | |
} | |
img:hover { | |
filter: none; | |
-webkit-filter: grayscale(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment