473,503 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

z-index of image in Opera 7.21


Javascript doesn't allow a hyphen in names, therefore when creating an
image element in javascript and wanting to specify 'z-index', I had to
spell it 'zindex'(image.style.zindex = 10;). But I am now confused as
to the proper way to handle hypenated CSS names. The 4th edition
Definitive Guide has index entries for 'z-index' and 'zIndex', but not
'zindex'. The HTML context is 4.01 strict and the browser is Opera 7.21.
What I am doing appears to work but I don't understand why.

--
Life is an offensive, directed against the repetitious mechanism of the
Universe.
--Alfred North Whitehead (1861-1947)
Jul 20 '05 #1
2 2551


Albert Wagner wrote:
Javascript doesn't allow a hyphen in names, therefore when creating an
image element in javascript and wanting to specify 'z-index', I had to
spell it 'zindex'(image.style.zindex = 10;). But I am now confused as
to the proper way to handle hypenated CSS names. The 4th edition
Definitive Guide has index entries for 'z-index' and 'zIndex', but not
'zindex'. The HTML context is 4.01 strict and the browser is Opera 7.21.
What I am doing appears to work but I don't understand why.


Throw out the hyphens and use camel casing
element.style.zIndex = '10'
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
DU
Albert Wagner wrote:
Javascript doesn't allow a hyphen in names, therefore when creating an
image element in javascript and wanting to specify 'z-index', I had to
spell it 'zindex'(image.style.zindex = 10;). But I am now confused as
to the proper way to handle hypenated CSS names. The 4th edition
Definitive Guide has index entries for 'z-index' and 'zIndex', but not
'zindex'. The HTML context is 4.01 strict and the browser is Opera 7.21.
What I am doing appears to work but I don't understand why.


It should always be camelCase when setting the property value via
javascript.

document.getElementById("imageId").style.zIndex = 10;
is correct.

http://www.w3.org/TR/2000/REC-DOM-Le...perties-zIndex

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1616
by: yihan | last post by:
Hi, I made a program to drag and drop the image using mouseevent, it only works on IE well, not on Netscape. Does anyone has the example suitable for Netscape? Please help. Thank you very much. ...
22
10328
by: DJ WIce | last post by:
Hi, I'm looking for a script to get the hi-est z-index on a page. I want my javascript menu to be always on top of the page (moves along on top when you scroll down). Does anyone know how to...
2
9491
by: gene | last post by:
I have some javascript code that displays random images in random places on the page by making changes to the document's css. This works in Safari and IE, but I can't get it to work on Mozilla. ...
7
2038
by: Warren Post | last post by:
I´m trying to implement a:hover popup images like Eric Meyer did at <http://meyerweb.com/eric/css/edge/popups/demo2.html>. My latest take is at...
7
1764
by: Sander Tekelenburg | last post by:
See <http://santek.no-ip.org/~st/tests/CSS/Opera/align.php>. Would appreciate confirmation that this is a bug in Opera, not my mistake. -- Sander Tekelenburg,...
3
2580
by: Andy Baxter | last post by:
I have an image scrolling in a viewport for a panoramic image viewer. The viewport can be resized to several set resolutions so people can adjust the size according to their bandwidth. There are...
1
6871
by: lwenkel | last post by:
This is what should happen in Firefox - this is in IE: http://www.sacu.com/locations/locate.asp This is the javascript that manupulates the images. It is slightly modified from the IE version. ...
5
1708
tpgames
by: tpgames | last post by:
I have my images at a different site, and wanted the game to access those images. I've changed the links in the other parts of the code, but still get a undefined error, and thought that the below...
0
877
by: comdec | last post by:
I am using a webtree control to control events on the web page. My problem is when I click on a child in the webtree I can identify the index, but I am having a problem posting that index to the...
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7072
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4998
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.