Advanced Search

Results 1 to 7 of 7

Thread: So close, but can't quite get z-index right...

  1. #1
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default So close, but can't quite get z-index right...

    1) Script Title: CSS Image Popup

    2) Script URL (on DD): http://www.dynamicdrive.com/style/cs...-image-viewer/

    3) Describe problem: Further insight needed involving z-indexes, object visibility on "Materials" <ul> items on page...

    I'm using the CSS Image Popup code from DynamicDrive, and it works great (without the need for javascript and what-not.) I learned a bit from that short snippet of code

    The one minor glitch I have is that my site uses multiple DIVs, and if one of the popups gets beyond the edge of my container DIV, it gets cut off completely, or placed behind the neighboring DIVs to the right or below the popup...

    I worked around it by being creative with the positioning of the popup to make sure it always stays inside the container DIV, but it doesn't look as great as it could.

    I played around a LOT with absolute vs. relative, different z-index settings for the container DIV and even all surrounding DIVs, forum searches... After two days of messing with it I have to throw up my hands in disgust.

    Can anyone take a look at http://www.bitcarving.com/materials.asp and tell me what the heck I am doing wrong?! If it is something simple I'll scream.
    Last edited by Snookerman; 05-03-2009 at 07:25 AM. Reason: added “Resolved” prefix

  2. #2
    Join Date
    Oct 2008
    Location
    n. 1 a particular place or position where something is located. 2 the action or process of locating.
    Posts
    2,026
    Thanks
    17
    Thanked 318 Times in 317 Posts
    Blog Entries
    3

    Default

    I didn't see any problems in Fx3.0.10 so I'm guessing this happens in another browser? Nevertheless, adding a z-index to the popup might help:
    Code:
    .thumbright span{ /*CSS for enlarged image*/
    position: absolute;
    background-color: white;
    border: 1px dashed gray;
    padding: 5px;
    left: -1000px;
    visibility: hidden;
    color: black;
    text-decoration: none;
    z-index: 10000;
    }
    Good luck!
    E d d y P r o c a
    I love Dropbox. Get it through my (girlfriend's) referral link and both you and I (her) get 250 MB extra! Thanks and you're welcome!

  3. #3
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for looking. I apologize - I had to redefine the thumbs to stay within their container divs, but I will post a mockup of the page. The error does occur in FF 3.0.10, and various versions of the error occur in IE 6, 7 and 8 based on how MS was feeling that day apparently.

    I appreciate your taking a look at it very much, and I will post the mockup to http://www.bitcarving.com/materials2.asp ASAP.

    Kindly note that when hovering over an Exotic Wood, the sample image is mostly obscured

    I did try the z-index as you suggested, as well as going back up a level of container divs and making sure everything was positioned (because z-index won't work on a static-positioned object) but it did not help. I feel like a CSS wannabe.

    Thank you again, it's very kind of you!

  4. #4
    Join Date
    Oct 2008
    Location
    n. 1 a particular place or position where something is located. 2 the action or process of locating.
    Posts
    2,026
    Thanks
    17
    Thanked 318 Times in 317 Posts
    Blog Entries
    3

    Default

    That's no a z-index issue, since the div has a specific width (510px) and the overflow is set to hidden, the content outside gets cut off. Remove the highlighted and it should fix it:
    Code:
    .boxWrap {
    float:left;
    margin:0;
    overflow:hidden;
    padding:0 0 40px;
    width:100%;
    }
    Good luck!
    E d d y P r o c a
    I love Dropbox. Get it through my (girlfriend's) referral link and both you and I (her) get 250 MB extra! Thanks and you're welcome!

  5. #5
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    GENIUS! And it works cross-browser

    How do you KNOW these things?

  6. #6
    Join Date
    Oct 2008
    Location
    n. 1 a particular place or position where something is located. 2 the action or process of locating.
    Posts
    2,026
    Thanks
    17
    Thanked 318 Times in 317 Posts
    Blog Entries
    3

    Default

    I use Firebug, it makes debugging a walk in the park. Of course, some CSS knowledge doesn't hurt

    Good luck with your site!
    E d d y P r o c a
    I love Dropbox. Get it through my (girlfriend's) referral link and both you and I (her) get 250 MB extra! Thanks and you're welcome!

  7. #7
    Join Date
    May 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Awesome! I'll check it out! Thank you again!

Tags for this Thread

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
  •