Last active
August 29, 2015 14:04
-
-
Save awhedbee22/f6b6d3899b49b786b13e to your computer and use it in GitHub Desktop.
Grayscale Hover Effect
This file contains hidden or 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.grayscale { | |
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 3.5+ */ | |
filter: gray; /* IE6-9 */ | |
-webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */ | |
-webkit-transition: all .5s ease-in-out; | |
-moz-transition: all .5s ease-in-out; | |
-ms-transition: all .5s ease-in-out; | |
-o-transition: all .5s ease-in-out; | |
transition: all .5s ease-in-out; | |
} | |
img.grayscale: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