Reputation: 67
Hi all that is my first question here :)
How can i reverse animation when mouse leave element?
<ul class="thumb-list">
<li>
<a href=""><img src="photo.jpg" alt="BlaBla"></a>
</li>
<li>
<a href=""><img src="photo.jpg" alt="BlaBla"></a>
</li>
<li>
<a href=""><img src="bd2.png" alt="BlaBla"></a>
</li>
</ul>
Upvotes: 1
Views: 999
Reputation: 240908
In this case, you should use a CSS transition as opposed to an animation. In doing so, the element can be transitioned when hovering on/off. Just place the transition properties on the img
element itself.
.thumb-list li a img {
height: 128px;
width: 128px;
border: 20px solid rgba(0, 0, 0, 0.3);
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
transition:all 1s ease;
-webkit-transition:all 1s ease;
-moz-transition:all 1s ease;
}
.thumb-list li a img:hover {
-moz-border-radius: 30%;
-webkit-border-radius: 30%;
border-radius: 30%;
}
Upvotes: 2