Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is a <a href="http://jsfiddle.net/ssEZm/" rel="nofollow">working fiddle</a>. The key is to <a href="http://api.jquery.com/stop/" rel="nofollow"><code>.stop()</code></a> the animation before adding a new one to the queue:</p> <pre><code>$(this).stop(true, true).animate(/***/); </code></pre> <p>However; this causes problems because multiple animations have to be run at once, so calling <code>.stop()</code> would interfere with the wrong animation. Therefore the different animations will have to be put in different animation <a href="http://api.jquery.com/queue/" rel="nofollow"><code>queues</code></a>:</p> <pre><code>$(this).stop('jump', true, true).animate({/***/}, { queue: 'jump' }); </code></pre> <p>If you use a different queue from the default (<code>fx</code>), you have to <a href="http://api.jquery.com/dequeue/" rel="nofollow"><code>.dequeue()</code></a> them manually.</p> <pre><code>$(this).stop('jump', true, true).animate({/***/}, { queue: 'jump' }) .dequeue('jump'); </code></pre> <p>[Edit] As for the first problem, I think the best solution is to <a href="http://api.jquery.com/delay/" rel="nofollow"><code>.delay()</code></a> the fade-out animation, to give the cursor some time to move on to the next block. Here is <a href="http://jsfiddle.net/k4Pu2/" rel="nofollow">a fiddle</a> with that included:</p> <pre><code>$(this).stop('fade', true).delay(300, 'fade').animate({ //*** </code></pre> <p>This has some downsides, mainly due to the fact that <a href="http://forum.jquery.com/topic/stop-does-not-clear-delay" rel="nofollow"><code>.stop()</code> does not cancel timeouts that were set by <code>.delay()</code></a>. My best solution is to have you choose between the "flash-effect" from the first fiddle, or the delayed fade-in effect from the second fiddle.</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