New dom created div, Always on top of other

AsteveNet

New Member
I'm creating some div:s with DOM, every time I click on a div it increases the z-index by one.The problem is that when lets say... I have created 10 div:s, the one on top will have Z-index:10 So if i create a new div it get Z-index:1 so Ill have to click it 11 times to get it on top.Any ideas how to sett this in JavaScript ? Or should i have it in CSS ?cheers Updated with a fiddle.http://jsfiddle.net/dymond/tQdFZ/20/Some problem with it though. the divs are not able to move when library is set to No-Wrap.If I change that to onload. the divs moves but the new box icon wont work.Css Code\[code\].box { width : 100px; height : 100px; position : absolute; background-color:red;}.hand{ width: 48px; min-height: 12px; background: yellow; z-index:1; border:1px solid black;}\[/code\]
 
Back
Top