...

View Full Version : problems using z-index in javascript



mcmcom
12-06-2004, 08:13 PM
Hi all,

got this code and get a syntax error on this line....


parent.document.getElementById('divviewer').style.height = "36px"
parent.document.getElementById('divviewer').style.z-index = "1";
// set browser to default pos and show
parent.document.getElementById('divbrowser').style.top = "36px";
parent.document.getElementById('divbrowser').style.height = "95%";
parent.document.getElementByID('divbrowser').style.z-index = "2";
parent.document.getElementById('divbrowser').style.visibility = "visible";

Its the z-index style
I have tried zindex, z-index, style.z-index, style.zindex and none of them work. Any ideas? Thanks

Puffin the Erb
12-06-2004, 08:18 PM
It should be .....style.zIndex

Willy Duitt
12-06-2004, 08:20 PM
It's: zIndex

Javascript follows camelCase convention and all style declarations with a hyphen have the hyphen removed and the first letter of the second word upperCase with no spaces in between words...

.....Willy

BTW: Although not a style declaration...
ismap when used in javascript is: isMap
(this one thru me for a loop until I searched the docs)

mcmcom
12-06-2004, 08:31 PM
Thanks!!!!

coothead
12-06-2004, 08:38 PM
Hi there Willy,

BTW: Although not a style declaration...
ismap when used in javascript is: isMap
(this one thru me for a loop until I searched the docs)

...and usemap becomes useMap :thumbsup:

coot :cool:

Willy Duitt
12-06-2004, 08:47 PM
Heh Coothead :D
Happy Holidays to you and yours :)

Yeah, you are right about useMap
There's a few more single word entities that I forget ATM....

Cheers;
.....Willy

Squishinator
06-02-2009, 05:12 AM
I tried that and it isnt working for me, not on IE or Firefox.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum