Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the problem is that when you move the mouse over the plus icon that triggers your <code>project-thumbnail</code> mouse leave handler which hides the plus icon, which in turn triggers the <code>project-thumbnail</code> mouse enter handler again which shows the plus icon - but your mouse is already over the plus so that triggers the mouse leave handler again, etc., etc., etc. Of course the stuttering is because of the animations starting and stopping repeatedly.</p> <p>You could perhaps revise your html structure to put the plus link inside the <code>project-thumbnail</code> div - bondythegreat's has you covered there.</p> <p>Or you could try a hack like this:</p> <pre><code>var projectThumbnail = $('.project-thumbnail'), imgWidth = projectThumbnail.width(), imgHeight = projectThumbnail.height(), timeoutID; // &lt;-- new variable projectThumbnail.mouseenter(function(e) { $(this).children('a').children('img').stop().animate({ height: imgHeight, left: '0', top: '0', width: imgWidth}, 100); $(this).children('a').children('span').stop().fadeIn(200); $(this).next('.zoom-button').show(); }).mouseleave(function(e) { // move original functionality into a timeout, saving a reference // to this for use within the timeout var $this = $(this); timeoutID = setTimeout(function() { $this.children('a').children('img').stop().animate({ height: imgHeight + 33, left: '-20', top: '-20', width: imgWidth + 50}, 100); $this.children('a').children('span').stop().fadeOut(200); $this.next('.zoom-button').hide(); }, 5); }); // cancel the timeout when entering the plus button $(".zoom-button").mouseenter(function(e) { clearTimeout(timeoutID); }); </code></pre> <p>Demo: <a href="http://jsfiddle.net/NrtvK/2/" rel="nofollow">http://jsfiddle.net/NrtvK/2/</a></p> <p>(I know this is pretty dodgy, but I tried it out of curiosity and when it worked I figured I might as well post it.)</p>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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