Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You just need to supply at least the first parameter to <code>.stop(true, true)</code> to clear the current queue and you can decide if you also want to supply the second parameter to jump to the end of the animation when the next one starts (that's up to you as it gives a slightly different effect). You also need to place the <code>.stop()</code> calls before the <code>.delay()</code> so you aren't clearing the <code>.delay()</code>. See the jQuery <a href="http://api.jquery.com/stop/" rel="nofollow">doc for <code>.stop()</code></a> to understand the two parameters for <code>.stop()</code>. When I do that here: <a href="http://jsfiddle.net/jfriend00/pYgQr/" rel="nofollow">http://jsfiddle.net/jfriend00/pYgQr/</a>, it seems to handle fast hover in/out just fine.</p> <pre><code>// On hover function var hover = $('#container'); hover.hover(function(){ $(this).find('#first').stop(true, true).animate({left:10}, 600); $(this).find('#second').stop(true, true).delay(100).animate({left:10}, 600); $(this).find('#third').stop(true, true).delay(250).animate({left:10}, 600); }, function() { $(this).find('#first').stop(true, true).animate({left:-100}, 600); $(this).find('#second').stop(true, true).delay(100).animate({left:-100}, 600); $(this).find('#third').stop(true, true).delay(250).animate({left:-100}, 600); }); // on mouse out hide divs </code></pre> <hr> <p>Also, I don't know why you're doing this at the beginning:</p> <pre><code>var hover = $('#container'); $(hover).hover(function(){ </code></pre> <p>You can either do this:</p> <pre><code>var container = $('#container'); container.hover(function(){ </code></pre> <p>or this:</p> <pre><code>$('#container').hover(function(){ </code></pre> <hr> <p>In addition, there is no reason to do:</p> <pre><code>$(this).find('#first') </code></pre> <p>These are ids which must be unique in the page so it's better to use:</p> <pre><code>$('#first') </code></pre> <p>This will be faster in jQuery because it will be able to just use <code>document.getElementById('first')</code> internally.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload