Skip to content

Instantly share code, notes, and snippets.

@ZAYEC77
Created January 8, 2016 23:40
Show Gist options
  • Save ZAYEC77/9c2b3f43c16cd869c803 to your computer and use it in GitHub Desktop.
Save ZAYEC77/9c2b3f43c16cd869c803 to your computer and use it in GitHub Desktop.
transition image grayscale on css3
.grayscale {
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray; /* IE 6-9 */
-webkit-transition: all 1s;
-moz-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
}
.grayscale:hover {
-webkit-filter: none;
-moz-filter: none;
-ms-filter: none;
-o-filter: none;
filter: none;
filter: none; /* IE 6-9 */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment