Take the 2-minute tour ×

I'm starting my jQuery studies. I am having difficulties making a continuous slide animation, with images of some clients passing by the screen. Everything is good until I try to PAUSE the function when the user passes the mouse over the <ul> that is passing. When this occurs, the animation stops. But to restart, it takes a short delay (even with the .clearQueue();) this short delay remains. how do I correct this to eliminate the delay?

The function:

animar('.clientesHome ul');

// pauses / iniciate animation
    $('.clientesHome ul').hover(

        function () {
            $('.clientesHome ul').clearQueue();
            $('.clientesHome ul').stop();   
        function () {
            animar('.clientesHome ul');

function animar(oque) {
            $(oque).css('left', $(oque).position().left);

            var regressivo  = 2000;

                left: '-' + $('.clientesHome ul li').width() + 'px'
            },  regressivo ,
            function (){
                $('.clientesHome ul li:first').clone().appendTo('.clientesHome ul');
                $('.clientesHome ul li:first').remove();

share|improve this question
add comment

1 Answer

When you're trying to find the bug, the best way it to strip down the code, to make it as simple as you can. This is your code striped down in jsfiddle: http://jsfiddle.net/r86Hk/. This example works just fine, there's no delay. In order to find your bug, start adding features of your code one by one, and when you see the delay, you've found your bug.

Without your original HMLT/CSS, this is the best I can do.

share|improve this answer
add comment

Your Answer


