C'est ce que je suis parvenu à ce jour, mais il semble que personne ne peut me aider avec les deux dernières fonctions:Comment mettre en pause une animation en boucle lors d'un basculement?
<script type='text/javascript''>
$(document).ready(function() {
swing();
});
function swing() { //making the div swing
$('#share').animate({right: '210px'}, 1000, function(){swingback()});
}
function swingback() { //making the div swing back
$('#share').animate({right: '220px'}, 1000, function(){swing()});
}
$('#share').mouseenter(function() { // stop any animation if the mouse enters the div
$(this).stop();
}).mouseleave(function() { // continue animation once the mouse has left the div
swingBack();
});
</script>
Alors, que fait-il dès maintenant? Est-ce qu'il ne s'arrête pas, ou recommence? –