|
I'm not sure you can programmatically change the zIndex and get the browser to re-render which object is on top. Maybe there is a way but zIndex is finicky and I've always had problems with it.
If I were doing this, I would do it this way:
Have each element's style.display set to "none".
Then whichever element you want to show up on top, set that elements style.display to "inline", and the others to "none".
That way only one object is shown at a time and you don't have to worry about overlapping.
|