views:

123

answers:

3

Hi Everyone,

Good Day, I used position:absolute for many div's in my website. I have used nearly 35 - 40 divs with absolute property.

Now i have a issue with z-index say some divs get hides, I realize this is because of z-index problem. I never declared z-index in my css.

I need to track the z-index of each divs. Is there any programs or scripts to find the z-index of the div's in my website?

Thanks in Advance

+1  A: 

First, it sounds like really bad programming having nearly 40 divs all using position:absolute and z-index. I would strongly recommend that you change the code to something more "user friendly".

But in this case, I would use jQuery to track your DIVs. create an array where you put the ID for each div in. Then you can loop through it and compare z-index values.

Or loop through the divs using the $.()each function.

Readmore about jQuery each here: http://docs.jquery.com/Core/each

Steven
Hi Steven,Its not a bad programming..As the requirement is like that. Also i have used 40 divs with absolute property for the whole website not a single page. Thanks for your suggestion..I will try using jquery.
Logesh Paul
+1  A: 

You can use a usual DOM recursive iteration to get to the id of the particular div you want and then display the z-index.

element = getFromDOM(your_div_id);
alert (element.style.zindex);

However, I would suggest you install Firebug in Firefox and view / alter the z-index of the div you want dynamically. Get Firebug here - http://getfirebug.com/

Crimson
Firebug is your friend when it comes to debugging :)
Steven
+1  A: 

You can use https://addons.mozilla.org/de/firefox/addon/60 for that. Use the topography feature or the display z-index featur under "Information"

Mike
Wow! Amazing add-on. Thanks a lot for sharing the great resource, I really appreciate your help.
Logesh Paul