DERNIÈRE CHANCE -20%
DERNIÈRE CHANCE -20%
En profiter
Webflow

Transition de page - Slide up

Javascript
HTML
CSS
Auteur
Aurélien Gallier
Démo lecture seule
Voir
Remix Link
Voir
Démo live
Voir

Copie-colle ce script dans le <body> de ton site Webflow


<script>
document.addEventListener('DOMContentLoaded', function() {
  // Style initial
  document.body.style.transform = 'translateY(0)';
  document.body.style.opacity = '1';
  document.body.style.transition = 'transform 0.4s ease, opacity 0.4s ease';
  
  document.querySelectorAll('a').forEach(link => {
    if (link.hostname === window.location.hostname && 
        !link.href.includes('#') && 
        !link.hasAttribute('target')) {
      
      link.addEventListener('click', function(e) {
        e.preventDefault();
        
        // Effet slide up + fade
        document.body.style.transform = 'translateY(-20px)';
        document.body.style.opacity = '0';
        
        setTimeout(() => {
          window.location.href = link.href;
        }, 400);
      });
    }
  });
  
  // Animation d'entrée
  window.addEventListener('load', function() {
    document.body.style.transform = 'translateY(0)';
    document.body.style.opacity = '1';
  });
});
</script>
  

ATTENTION : Ne pas appliquer d'animations natives sur les liens de navigation pour éviter tout conflit.

Tuto vidéo

Crées une animation stylée pour tes transitions de page pour une navigation plus fluide !

Envie d'aller plus loin ?
Je m'inscris