Results 1 to 6 of 6

Thread: CSS Popup Image Viewer

  1. #1
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS Popup Image Viewer

    Hi,

    I was able to make the CSS Popup Image Viewer shown here work as a pop down, but when I changed the .thumbnail:hover span top attribute to -400 instead of -1000 I'm getting different results in Firefox and IE7. Any ideas how to make them render approximately the same? IE is rendering a couple of hundred pixels higher than firefox.

    Here are the changes I made in the stylesheet:

    <style type="text/css">

    .thumbnail{
    position: relative;
    z-index: 0;
    }

    .thumbnail:hover{
    background-color: transparent;
    z-index: 50;
    }

    .thumbnail span{ /*CSS for enlarged image*/
    position: absolute;
    background-color: #333333;
    padding: 0px;
    left: -1000px;
    /*border: 1px dashed gray;*/
    visibility: hidden;
    color: black;
    text-decoration: none;
    }

    .thumbnail span img{ /*CSS for enlarged image*/
    border-width: 0;
    padding: 2px;
    }

    .thumbnail:hover span{ /*CSS for enlarged image on hover*/
    visibility: visible;
    top: -400px;
    left: 0px; /*position where enlarged image should offset horizontally */

    }

    </style>

    TIA

    Jeff

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can you please tell me what the difference between the popup or popdown? I can't figure out, because the image already does popdown. :-/
    Jeremy | jfein.net

  3. #3
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hey VG,

    That's happening because of the IE's messed up box model. I'm betting that IE is off by exactly the height of your thumnail image, right?

    The solution? Add an IE only CSS statement. Working off the example on the demo page (height of 66px), it would be this:

    Code:
    .thumbnail:hover span{ /*CSS for enlarged image on hover*/
    visibility: visible;
    top: -400px;
    *top: -334px;
    left: 60px; /*position where enlarged image should offset horizontally */
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Excellent Thanks

    Hi Medyman,

    So by putting * in front of a CSS statement only IE will read it? I've never heard that, thanks.

    VG

    Quote Originally Posted by Medyman View Post
    Hey VG,

    That's happening because of the IE's messed up box model. I'm betting that IE is off by exactly the height of your thumnail image, right?

    The solution? Add an IE only CSS statement. Working off the example on the demo page (height of 66px), it would be this:

    Code:
    .thumbnail:hover span{ /*CSS for enlarged image on hover*/
    visibility: visible;
    top: -400px;
    *top: -334px;
    left: 60px; /*position where enlarged image should offset horizontally */
    }

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by VaporGlide View Post
    Hi Medyman,

    So by putting * in front of a CSS statement only IE will read it? I've never heard that, thanks.

    VG
    Yup! It's comes in handy. I wouldn't rely too heavily on it. Most things, if coded in a standards compliant way, will render the same across most browsers. There are some sticking points though (as in this case) where the little IE hack is useful.

  6. #6
    Join Date
    Apr 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Quote Originally Posted by Medyman View Post
    Yup! It's comes in handy. I wouldn't rely too heavily on it. Most things, if coded in a standards compliant way, will render the same across most browsers. There are some sticking points though (as in this case) where the little IE hack is useful.
    I just tried it out and it works brilliantly... thanks for the hand.

    VG

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
  •