Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>edit: original below for historic reasons</strong></p> <p>I've got this problem solved, you can find the solution at <a href="http://jsbin.com/hogantest/5" rel="nofollow noreferrer">http://jsbin.com/hogantest/5</a> and of course see all the source and play with it at <a href="http://jsbin.com/hogantest/5/edit" rel="nofollow noreferrer">http://jsbin.com/hogantest/5/edit</a></p> <p>Because <code>stop()</code> does not work with <code>fadeIn()</code> and <code>fadeOut()</code> there is a funkyness with the arrows sticking around if you move the mouse pointer fast. I leave the fix for the OP.</p> <p>Here were the issues and solution. Problem 1 was not using stop correctly. You only want to use stop on the fade out item. This will stop the fade in and start a fade out right away. Also (as my original comment) you want to stop first then do the work.</p> <p>Problem 2 was the dynamic adding of images in the hover. YIKES! Add the images in hidden once and only once, then manipulate them.</p> <p>Here is the relevant part of the revised code:</p> <pre><code>$(document).ready(function() { $(".fade").each( function() { $(this).append($("&lt;img style='float:right;' src='http://cu3ed.com/jqfade/img/plus.png' /&gt;")); $(this).find("img:last").hide(); }); $(".fade").hover( function () { var me = $(this); me.find("img:last").fadeIn(500); me.animate({ opacity: 1, borderBottomColor: "#6BD8FF", borderLeftColor: "#6BD8FF", borderRightColor: "#6BD8FF", borderTopColor: "#6BD8FF", color: "#03A5DF", backgroundColor: "#E3F8FF" }, 500); }, function () { var me = $(this); me.stop(); me.find("img:last").fadeOut(200); me.animate({ opacity: 1, borderBottomColor: "#CCCCCC", borderLeftColor: "#CCCCCC", borderRightColor: "#CCCCCC", borderTopColor: "#CCCCCC", color: "#BBBBBB", backgroundColor: "#F9F9F9" }, 200); } ); });​ </code></pre> <p>As I said there is still a fix -- get rid of <code>fadeIn()</code> and <code>fadeOut()</code> and use animate so you can call <code>stop()</code>. I would also add the img tag to the original html code, there is no reason to add it dynamically unless this is a grease monkey script or something of that sort.</p> <p><strong>original answer</strong></p> <p>This is a guess, it is late so I'm not testing it... move the stop() before the image fade in. </p> <pre><code>function () { var me = $(this); me.stop(); me.fadeIn(500).append($("&lt;img class='plus' src='img/plus.png' /&gt;")); me.animate({ opacity: 1, borderBottomColor: "#6BD8FF", borderLeftColor: "#6BD8FF", borderRightColor: "#6BD8FF", borderTopColor: "#6BD8FF", color: "#03A5DF", backgroundColor: "#E3F8FF" }, 500); }, </code></pre>
    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.
 

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