Note that there are some explanatory texts on larger screens.

plurals
  1. POHovering a hiding element replays the hide animation shortly after
    text
    copied!<p>I have 2 elements next to each other, both absolutely positioned.</p> <pre><code>&lt;div class="vizual"&gt; &lt;h1 class="typo"&gt;...&lt;/h1&gt; &lt;a href="#" class="typo"&gt;...&lt;/a&gt; &lt;/div&gt; </code></pre> <p>When I hover over the first element, the other element appears next to it. There are some effects and timers going on.</p> <pre><code>function hoverTransfer(trigger,content){ var t; $(trigger).hover( function(){ clearTimeout(t); if ($(content).css("display") == "none") { $(content).show('slide', {direction: 'left'}, 500); } }, function(){ t = setTimeout(function() {$(content).hide('slide', {direction: 'left'}, 500)}, 550); }); $(content).hover( function(){ clearTimeout(t); }, function(){ t = setTimeout(function() {$(content).hide('slide', {direction: 'left'}, 500)}, 550); }); }; </code></pre> <p>It should work in a way, that when I keep mouse hovered over one of the two elements, the second element stays displayed. When I move the mouse out, after some time it slides back in. </p> <p><strong>EDIT:</strong> If I hover over one of the elements while the second one is hiding, it should slide back to full width. But that I can't produce too...</p> <p><em><strong>PROBLEM -</em></strong> It also behaves in a way that's unwanted: When I hover <strong>in and out</strong> of one of these elements <strong>while</strong> the second element is hiding, it replays the hiding animation again shortly after it's finished.</p> <p>I tried a lot of different "solutions" (checking whether elements are animated, trying to .stop() them etc, but I could never produce the desired functionality.</p>
 

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