Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS: can't understand how to work with the z-index
    primarykey
    data
    text
    <p>First of all I am a programmer (Python, C, Java, Delphi, whatever) and not a web developer/designer. I am trying hard to be (when asked) so please bear with me. :-)</p> <p>I have a map (background image of div). On the map I have placed some cities (div with image). Underneath the cities there are cars (div with image, too). Each car can travel to any city (drag-drop, I am working on this now). Cities and cars, when clicked-once, show pop up dialogs with extra information. </p> <p>Up to here, no news. What a normal programmer would want is to have the map on the first level (i.e. z-index 0) cities on the next (i.e. z-index 10) cars on the next (z-index 20 because when dragged and dropped cars should appear above the cities and not bellow) and finally above all the popups (z-index 999). </p> <p>However this is not the case. Cars when dragged "fly" above some cities and "pass" below some other (depending if they were placed before or after the city while rendering the page, I suppose). </p> <p>I was trying hard to place a div (to draw lines) in between the map div and the cities (ie z-index 5) but to no avail.</p> <p>Popups also have problems.</p> <p>I also tried this piece of code:</p> <pre><code>jQuery(document).ready(function(){ map_zindex = $("#map").css("z-index"); $(".city").css("z-index", map_zindex+10); $(".car").css("z-index", map_zindex+100); $(".popup").css("z-index", map_zindex+200); }); </code></pre> <p>Still nothing changes (not even a small progress). Nothing. Worst of all, when checking with <a href="http://en.wikipedia.org/wiki/Firebug" rel="nofollow">Firebug</a> I was getting a <code>z-index: auto;</code> to all of those elements.</p> <p>I know I must be doing something completely wrong, but what is it? I hope my dislike for CSS is not causing all this mess. </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