Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to stop css hover out with a conditional
    text
    copied!<p>I have 2 buttons on a box... the box has a css:hover, I would like to "stop" the unhover if the mouse is on the buttons... I can use js, but I prefer to do not. It's the last alternative.</p> <p>My code:</p> <p><a href="http://jsfiddle.net/SXj2W/3/" rel="nofollow">http://jsfiddle.net/SXj2W/3/</a></p> <pre><code>&lt;html&gt;&lt;head&gt; &lt;style type="text/css"&gt; .annimation{ webkit-transition: all 1s; transition: all 1s; } .annimation:hover{ -webkit-transform: translate(100px, 100px) scale(5, 5); transform: translate(100px, 100px) scale(5, 5); } &lt;/style&gt; &lt;script type="text/javascript"&gt; function onMouseOut(self,event) { var e = event.toElement || event.relatedTarget; while(e &amp;amp;&amp;amp; e.parentNode &amp;amp;&amp;amp; e.parentNode != window) { if (e.parentNode == self|| e == self) { if(e.preventDefault) e.preventDefault(); return false; } e = e.parentNode; } //do some shit } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div style="z-index:1;width: 10px;position:absolute;" id="buttons"&gt;&lt;div style="width:10px;height:10px;position:relative;float:left;background-color: rgb(0,255,0);"&gt;&lt;/div&gt;&lt;div style="width:10px;height:10px;position:relative;float:left;background-color: rgb(0,255,0);"&gt;&lt;/div&gt;&lt;/div&gt; &lt;div onmouseout="onMouseOut(this,event)" style="width:50px; height:50px;overflow:hidden;" class="annimation" id="father"&gt; &lt;div style="margin-top:0px;width:100%;height:100%;transition: margin 2s;" id="container"&gt; &lt;div onclick="document.getElementById('container').style.marginTop='-50px'" style="width: 50px;height:50px;background-color:rgb(255,0,0);"&gt;&lt;/div&gt; &lt;div onclick="document.getElementById('container').style.marginTop='0px'" style="width: 50px;height:50px;background-color:rgb(0,0,255);"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt;&lt;/html&gt; </code></pre>
 

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