I would like to blur an image when hovering.
The problem is that the edges of the image also blur unpleasantly. In the Fiddle you can see it clearly with the green back
Seems that setting a clip solves more or less the issue. However, there is an strange effect at the end of the transition. Forcing th GPU (via a translateZ hack) seems to solve the problem.
CSS
div {
width:300px;
height:300px;
position: absolute;
}
.no {
left: 400px;
top: 10px;
}
.box img {
transition: 2s -webkit-filter;
position:absolute;
left: -3px;
top:-3px;
clip: rect(5px 295px 295px 5px);
-webkit-transform: translateZ(0px);
}
div img {
transition: 2s -webkit-filter;
position:absolute;
left: -3px;
top:-3px;
clip: rect(5px 295px 295px 5px);
}
div img:hover{
-webkit-filter: blur(8px);
}
demo with a comparative with and without the transform