Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>if you look into the dom structure like this:</p> <pre><code>&lt;div class="parent"&gt; &lt;div&gt; &lt;div class="top"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="laterindom"&gt;&lt;/div&gt; </code></pre> <p>the z-index depends on the layout / style.</p> <p>elements which are located before other elements are positioned "below" them in z-index herarchy, except you are specifiying z-index for them.</p> <p>elements "in" another element (like the class="top" element) are are above their parents in the z-index, but the mouseover event will bubble up in dom by default, so if you attach the mouseover event to the "parent" class, your method will be called too, because it bubbles up, even if the "top" element is "above" your "parent" element :)</p> <p>by the way, you can prevent the event bubbling by calling event.stopPropagation() like this:</p> <pre><code>$(element).mousemove(function(event) { event.stopPropagation(); //some other code here }); </code></pre> <p>if you now set z-index for the parent to 1, and the z-index for "top" to 9 but the z-index of "laterindom" to 2, the "laterindom" element will be above your "top" even if the "top" element should be higher.. sad, but it is defined like that.</p> <p>in this example: <a href="http://jsfiddle.net/R59Q8/3/" rel="nofollow">http://jsfiddle.net/R59Q8/3/</a> the city is above the scroll window, but the element below the scroll window in dom is above the city, even if the city has z-index 9 and the topmost element only 2.</p> <p>hope this helps</p>
    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.
 

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