Results 1 to 3 of 3

Thread: CSS Popup Image Viewer Modification

  1. #1
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS Popup Image Viewer Modification

    Hello all,

    I would like to modify the CSS originally created here:

    http://www.dynamicdrive.com/style/cs...-image-viewer/

    Here are my three questions/modifications:

    1) How would you edit the styles if you wanted the enlarged picture to appear to the left of the image? I've tried toying with it some, and can get the enlarged image to appear more to the left of the image, but all it does is stretch the enlarged image from the far right to the far left.
    2) Is it possible to edit it so that the enlarged image will disappear as soon as you move off the thumbnail. Right now, the large image stays on the screen as long as the mouse is on the thumbnail or anywhere on the expanded image.
    3) Is there a way to make your webpage length expand if the large image drops below the page? I have a thumbnail that is close to the bottom of the page. Currently, if it is expanded the image goes below the current length, and it is hidden from view. It would be nice if the page length could lengthen when the image is there, and shrink when it is not. Or, instead of the image enlarging below the thumbnail, if it would expand upwards, that would work too. Thanks in advance.

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

    Default

    How would you edit the styles if you wanted the enlarged picture to appear to the left of the image? I've tried toying with it some, and can get the enlarged image to appear more to the left of the image, but all it does is stretch the enlarged image from the far right to the far left.
    Make the highlighted changes (red are styles that should be deleted);
    Code:
    .thumbnail span{ /*CSS for enlarged image*/
    position: absolute;
    background-color: lightyellow;
    padding: 5px;
    left: -1000px;
    right: -1000px;
    border: 1px dashed gray;
    visibility: hidden;
    color: black;
    text-decoration: none;
    }
    
    .thumbnail:hover span{ /*CSS for enlarged image on hover*/
    visibility: visible;
    top: 0;
    left: 60px; /*position where enlarged image should offset horizontally */
    right: 60px; /*position where enlarged image should offset horizontally */
    
    }

    Is it possible to edit it so that the enlarged image will disappear as soon as you move off the thumbnail. Right now, the large image stays on the screen as long as the mouse is on the thumbnail or anywhere on the expanded image.
    You have two options. The one that I recommend if you want this to happen is to not overlap the thumbnail and the enlarged image. You might still want to add the below style as assurance.

    The second option is to add the following style. It will not work in IE6. If the thumbnail and large image overlap and you mouse over the overlapped area, you will get a flickering effect.

    Code:
    span:hover {
    	visibility:hidden!important;
    }

    Is there a way to make your webpage length expand if the large image drops below the page? I have a thumbnail that is close to the bottom of the page. Currently, if it is expanded the image goes below the current length, and it is hidden from view. It would be nice if the page length could lengthen when the image is there, and shrink when it is not. Or, instead of the image enlarging below the thumbnail, if it would expand upwards, that would work too.
    You'll need to employ some JavaScript for that. Check in the JS forum for further advice on how to go about doing that.

  3. #3
    Join Date
    Oct 2008
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, this got me exactly what I needed.

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
  •