I am trying to create an effect where a .gif animation plays once when the mouse hovers over a specific image. I have one static image in PNG format and one animated gif.
The goal is for the gif to play every time the mouse is hovered over the png image. However, I am encountering an issue where the gif only plays once when the mouse is first moved over the image. If I move the mouse away and then back again, the gif does not replay as intended.
Here is my CSS code:
#icon{
float: left;
width:50px;
height:50px;
background: url("images/smal_icon.png") no-repeat scroll 0% 0% transparent;
}
#icon:hover{
float: left;
width:50px;
height:50px;
background: url("images/smal_icon.gif") no-repeat scroll 0% 0% transparent;
}
The #icon
element is a DIV.