Comment puis-je déclencher un slideUp(); avec un démarrage différé, mais qui ne force pas le reste du code à attendre qu'il ait fini avant de progresser. Par exemple: Un bouton est enfoncé et 1 seconde plus tard une boîte disparaît, mais jquery fonctionne encore pendant cette seconde.Comment différer une animation (dans jquery)
Répondre
Voir ce previous SO question sur exactement le même sujet.
setTimeout(function() { /* code to run */ }, delay_time_in_milliseconds);
Désolé. Bien trouvé. –
Pas besoin de vous excuser. :) – Amber
Vous pouvez utiliser la fonction setTimeout()
de Javascript pour cela.
E.g.
setTimeout(function() { $('#someid').slideUp(); }, 1000); // 1000ms = 1sec.
Vous pouvez utiliser la méthode .delay()
de jQuery pour la file d'attente des animations.
$('#el').delay(1000).slideUp();
Si vous voulez retarder quelque chose d'autre, puis utilisez intégré setTimeout()
fonction de JavaScript.
setTimeout(function() {
// code to be executed
}, 1000);
Notez que vous devez spécifier le délai en millisecondes dans les deux cas. 1000 ms = 1 s.
- 1. Comment retarder une animation dans jquery
- 2. Jquery animation dans firefox
- 3. Comment écrire une animation jQuery dans cette situation?
- 4. jQuery: bloqué animation jquery
- 5. jquery animation
- 6. jquery - animation
- 7. Lent animation jQuery dans IE
- 8. animation en utilisant jquery
- 9. Animation Jquery/Javascript
- 10. JQuery animation Question
- 11. jQuery - Animation provoque une superposition Div IE7
- 12. Animation Jquery Ajax?
- 13. jQuery facilité animation
- 14. Aide jQuery Animation
- 15. jQuery Animation and Classes
- 16. JQuery hover avec animation
- 17. Ajax jQuery animation chaîne
- 18. Problème avec jQuery Animation
- 19. Animation synchrone JQuery
- 20. jquery animation done
- 21. couleur jQuery animation
- 22. Animation de menu jQuery
- 23. jQuery animation mousemove
- 24. jQuery animation répète glitch
- 25. Animation: jQuery ou Raphael?
- 26. Comment différer un bloc avec emacs?
- 27. Comment arrêter une animation jquery basée sur les valeurs CSS?
- 28. comment faire une animation constante en utilisant jquery
- 29. Comment supprimer une animation pour ce plugin modulaire jQuery?
- 30. jQuery Animation Slide Left
duplication possible de [delay effets JQuery] (http://stackoverflow.com/questions/251204/delay-jquery-effects) – Shog9