Click to See Complete Forum and Search --> : zIndex


moofdaddy
04-14-2006, 03:48 PM
Greetings,
I am trying to get zIndex working in my safari /mac firefox client and its driving me crazy. I haven't tested it on another system yet and I have read as much as i can but is still won't work. Here is what I have...



var layer2;
layer2 = document.getElementById("layer2");
var layer1 = document.getElementById("layer1");
layer2.zIndex = 1;
layer1.zIndex = 0;




I also tried using layer2.style.zIndex and that didn't help either. I don't get an error and I when i try to alert layer2.zIndex it either shows nothing or it prints undefined. Any ideas what I may be doing wrong?

Kor
04-14-2006, 03:54 PM
object.style.zIndex='1'

...and... do not give yor variable the same name as the id, IE don't like this

moofdaddy
04-14-2006, 03:56 PM
object.style.zIndex='1'

ahh, missed the quotes around the numbers, thanks!

Kor
04-14-2006, 03:58 PM
...and... do not give yor variable the same name as the id, IE doesn't like this