Répétition d'une animation
Hello a tous,
J'ai une petite fonction js qui load des images dans un div :
Code:
1 2 3 4 5
| <div id="presentoire" style="margin:30px;padding:30px;">
<center>
<img id="main_picture" src="" width="" height="">
</center>
</div> |
Et voici la fonction js :
Code:
1 2 3 4 5
| function displayPicture(id)
{
document.getElementById("main_picture").src = data;
document.getElementById('main_picture').style.animation = "display_picture 2s";
} |
Et voici l'animation qui est loadee :
Code:
1 2 3 4 5 6 7 8 9 10 11
| @keyframes display_picture
{
from {opacity:0;}
to {opacity:1;}
}
@-webkit-keyframes display_picture /* Safari and Chrome */
{
from {opacity:0;}
to {opacity:1;}
} |
Mon probleme est que l'animation n'est repetee quune fois alors que je la voudrais a chaque chargement dimage. Pouvez vous maider ?
Merki.
FS