Fix apercu animation + reseaux sociaux a prevoir
- Corrige le bug ou l'apercu montrait toujours la meme animation (force reflow correct entre retrait et ajout de classe CSS) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -306,14 +306,15 @@ function testerAnimation() {
|
||||
} else {
|
||||
chiffre.textContent = count;
|
||||
}
|
||||
chiffre.className = 'anim-chiffre anim-' + animationChoisie;
|
||||
// Force reflow pour relancer l'animation
|
||||
chiffre.style.animation = 'none';
|
||||
chiffre.offsetHeight;
|
||||
chiffre.className = 'anim-chiffre anim-' + animationChoisie;
|
||||
// Reset : retirer toute classe d'animation
|
||||
chiffre.className = 'anim-chiffre';
|
||||
// Force reflow pour que le navigateur enregistre le retrait
|
||||
void chiffre.offsetWidth;
|
||||
// Appliquer la nouvelle animation
|
||||
chiffre.classList.add('anim-' + animationChoisie);
|
||||
|
||||
count--;
|
||||
if (count > 0) setTimeout(afficher, 800);
|
||||
if (count > 0) setTimeout(afficher, 1000);
|
||||
}
|
||||
|
||||
afficher();
|
||||
|
||||
Reference in New Issue
Block a user