Return color on hover
Posted
by
alonblack
on Stack Overflow
See other posts from Stack Overflow
or by alonblack
Published on 2013-11-10T15:37:57Z
Indexed on
2013/11/10
15:53 UTC
Read the original article
Hit count: 149
Here i created 3 images that goes from color to grayscale and i want to show the color on hover what i'v done wrong?
here is the fiddle link:
css code:
.box {
float: left;
position: relative;
width: 14.285714286%;
}
.boxInner img {
width: 100%;
display: block;
}
.boxInner img:hover {
-webkit-filter: grayscale(0%);
}
@-webkit-keyframes toGrayScale {
to {
-webkit-filter: grayscale(100%);
}
}
.box:nth-child(1) img {
-webkit-animation: toGrayScale 1s 0.5s forwards;
}
.box:nth-child(2) img {
-webkit-animation: toGrayScale 2s 1s forwards;
}
.box:nth-child(3) img {
-webkit-animation: toGrayScale 3s 1.5s forwards;
}
© Stack Overflow or respective owner