jQuery start and stop in asynchronous code

jQuery start and stop in asynchronous code

Hi, I was able to stop and restart an animation with the following code. Could someone who has some understanding tell me if this is a good way? I have seen there is a way to pass a variable like “fx” to the queue dequeuer and clearQueue functions. I don’t know how to use it yet; could somebody show an example. I am thinking that it could be helpful here, so I can remove a queue for some time and pick it up later (e.g mouseover). This project has taught me about asynchronous code because it is underneath more code that is calling a setInterval. I see that this code will run if conditions are true while the setInterval is firing all the time. I am I correct to assume that it should be the logic in your code that makes it ignore what a timing function is doing? Thanks
  1. $('.marquee_container_1').html(marqueeVars.panelContent[navClicked])
    .animate({left: 0},marqueeVars.durAni)
    .delay(marqueeVars.durStatic)
    .queue(function(){

        $(this).hover(function(){
            $(this).clearQueue();
        }, function() {
            $(this).delay(600).animate({left: 1100},marqueeVars.durAni);
        });               


    }).dequeue().animate({left: 1100},marqueeVars.durAni);