Results 1 to 10 of 10

Thread: Question about z-index attribute in style

  1. #1
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default Question about z-index attribute in style

    When I was looking at a JavaScript created by jscheuer1 (John), I noticed something about z-index in a style attribute. What does z-index do?

    -magicyte

  2. #2
    Join Date
    Jul 2008
    Posts
    199
    Thanks
    6
    Thanked 58 Times in 57 Posts

    Default

    If X is width, and Y is height, what must Z be? Depth, of course!

    If any elements are overlapping, they will stack accordingly based on their z-index. The ones with the higher index will be higher up, the lower index ones will go to the bottom.

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,625
    Thanks
    6
    Thanked 107 Times in 107 Posts

  4. #4
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Thanx guys! Man! I never knew that. Finally! I can make images OVERLAP! It's a miracle.

    -magicyte

  5. #5
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,823
    Thanks
    49
    Thanked 240 Times in 233 Posts
    Blog Entries
    56

    Default

    Notice that certain elements like select boxes and activeX in IE always have the highest z-index. There's nothing you can do about that.
    ===
    Arie Molendijk

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by molendijk View Post
    Notice that certain elements like select boxes and activeX in IE always have the highest z-index. There's nothing you can do about that.
    ===
    Arie Molendijk
    I'm not sure what you mean by Active X, it is such a broad category. Something as simple as an element with style filter(s) in IE is technically Active X, but it will still follow the rules and peculiarities for z-index stacking. The select element bug was corrected in IE 7. Iframe in earlier Opera had this problem as well. All Flash in all browsers exhibits this issue unless its wmode is set to transparent. Other object and embed (deprecated) elements can too (in many browsers), but there is often no equivalent to wmode for them, or none that is widely known.

    One caveat for z-indexing is that (in the broadest use, including browsers that do not do fixed positioning for all elements, or that do not do it correctly with regard to z-indexing), the elements involved in stacking must both have either position absolute or relative. One can be absolute, the other relative, but each element involved in the stacking process must be one or the other. This is not required in all browsers, but in enough of them to make it an important requirement.

    There are other issues involved, but the above takes in the major ones.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,823
    Thanks
    49
    Thanked 240 Times in 233 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by jscheuer1 View Post
    I'm not sure what you mean by Active X, it is such a broad category.
    Not very long ago, <object data=... ></object> gave me a headache. It's windowed in all versions of IE (but I don't know about IE8).
    ---
    Arie.

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by molendijk View Post
    Not very long ago, <object data=... ></object> gave me a headache. It's windowed in all versions of IE (but I don't know about IE8).
    ---
    Arie.
    Ah well, yes I recall discussing that (or something similar) with you in fact. That (what we were discussing before with the Google page object) would fit into the category of objects that have no wmode setting or equivalent that is widely known, but in this case only as regards IE because it happened to work as desired in other browsers (iframe worked for it in IE though as I recall).

    However, I'm not certain what we were discussing before was an Active X object. It appeared to me to merely be an ordinary object element.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,823
    Thanks
    49
    Thanked 240 Times in 233 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by jscheuer1 View Post
    Ah well, yes I recall discussing that (or something similar) with you in fact. That (what we were discussing before with the Google page object) would fit into the category of objects that have no wmode setting or equivalent that is widely known, but in this case only as regards IE because it happened to work as desired in other browsers (iframe worked for it in IE though as I recall).

    However, I'm not certain what we were discussing before was an Active X object. It appeared to me to merely be an ordinary object element.
    We were discussing this. In IE, there seems to be no way of having windowless elements on top of <object type="text/html"></object>. Notice also that <object type="text/html"></object> provokes an 'ActiveX prompt' in IE when used locally.
    ===
    Arie.

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not sure if that makes it an Active X object. IE gives exactly the same warning for any javascript.

    I think the warning for the script tag and for the object tag are similar. You can use an object tag to show an image - harmless. And a script tag to just do a document.write('Hello world!'); - equally harmless. But either one, script or object tag, can be used in IE to run controls on your computer that will trash it. The programmers of IE just never bothered to write in code to tell the difference between harmless and harmful scripts and objects, while apparently they have to a degree for style tags (where only filters and behaviors will trigger this same Active X warning, but then indiscriminately once again for both safe and for harmful ones).
    Last edited by jscheuer1; 07-15-2008 at 01:12 PM. Reason: add info about style
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •