Note that there are some explanatory texts on larger screens.

plurals
  1. POmouseenter + mouseleave / hover on two different div
    text
    copied!<p>Hi ive got this piece of code to deal with mouseenter and leave on 2 superposed div</p> <p>When a user mouseenter the main div the sub div is showed, and if the user get in the subdiv the subdiv must remain, but if the user get out the maindiv and is not in the subdiv the subdiv must be hidden, try with my jsfiddle <a href="http://jsfiddle.net/rgkcp/" rel="nofollow">http://jsfiddle.net/rgkcp/</a></p> <p>but the timer is not run in my piece of code</p> <pre><code> $(".bulleHome").each(function () { var subDiv = $(this).find(".mupHome"); $(this).mouseenter(function () { $(this).find(".mupHome").css("visibility", "visible"); $(this).find(".mupHome").animate({ marginTop: '-23px' }); }); $(this, subDiv).mouseleave(function () { // this is not run timer = setTimeout(function () { $(this).find(".mupHome").css("visibility", "hidden"); $(this).find(".mupHome").animate({ marginTop: '+23px' }) }, 50); }); $(this, subDiv).mouseenter(function () { clearTimeout(timer); }); }); </code></pre> <p>And the html :</p> <pre><code>&lt;div class="bulleHome ombreV"&gt; &lt;a href="http://preprod.mupiz.com/georges-barret" style="font-size:0.7em;text-decoration:none;" pid="13200"&gt; &lt;img src="http://www.mupiz.com/images/img-membres/images_4958C.jpg" alt="Georges profil" height="100px"&gt;&lt;br&gt; &lt;/a&gt; &lt;div class="mupHome" style="visibility: visible; margin-top: -23px;"&gt; &lt;img src="http://www.mupiz.com/images/mupitR.png" alt="Mup It!" id="bouton-ajout-ami13200" onclick="alert('ok')" style="cursor: pointer;"&gt;&lt;span class="tMupHome"&gt;Mup it!&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And the linked css :</p> <pre><code>.mupHome{position:absolute;color:#fff;background: rgb(0, 0, 0) transparent;background: rgba(0, 0, 0, 0.8);filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";width:100px;visibility:hidden;height:19px;} .tMupHome{position:relative;top:-8px;left:5px} </code></pre> <p>Any ideas ?</p> <p>Js Fiddle : <a href="http://jsfiddle.net/rgkcp/" rel="nofollow">http://jsfiddle.net/rgkcp/</a></p> <p>Thanks!</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