I created a hover effect that zooms scale(1.5)
into the image, but when it exits the hover the border-radius
of the image redoes the square image before to return to border-radius
original. The problem only happens in Chrome and Safari. Here is my code below:
.hoverzoom {
position: relative;
min-width: 250px;
overflow: hidden;
border-radius: 8px;
}
.hoverzoom > img {
width: 100%;
border-radius: 8px;
-webkit-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
-moz-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
-ms-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
-o-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
}
.hoverzoom:hover > img {
-webkit-transform: scale(1.5);
-moz-transform: scale(1.5);
-ms-transform: scale(1.5);
-o-transform: scale(1.5);
transform: scale(1.5);
}
.hoverzoom .retina{
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
opacity: 0;
background: none repeat scroll 0 0 rgba(31, 124, 43, 0.5);
border-radius: 8px;
text-align: center;
padding: 30px;
-webkit-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
-moz-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
-ms-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
-o-transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
transition: all .8s cubic-bezier(.190, 1.000, .220, 1.000);
}
.hoverzoom:hover .retina {
opacity: 1;
box-shadow: rgba(0,0,0,.5);
}
<div class="hoverzoom">
<img src="https://i.stack.imgur.com/aipDU.jpg"><ahref="#">
<div class="retina"></div>
</a>
</div>
Does anyone know what's wrong?