CSS Library: Image CSS: Here
CSS Popup Image Viewer
Author: Dynamic Drive
Enable arbitrary links or image thumbnails to pop up an enlarged (different) image onMouseover by using this CSS code. With the help of CSS's ":hover" pseudo class, combined with relative and absolute positioning, the enlarged images are simply included on the page as normal HTML, "popping" up on demand. CSS is behaving more and more like scripting!
Demo:
One of my favorite foods is sushi
Doesn't this look good?, and it's good for you too! Coffee and sushi probably don't mix well, but I like some Zoka Coffee
Zoka Coffee to boot! Here are some thumbnails from my trip to La la land:
![]()

Simply beautiful.
![]()

So real, it's unreal. Or is it?
The CSS:
Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.
Comment Pages 7 of 53 pages « First < 5 6 7 8 9 > Last »
.thumbnail:hover span{ /*CSS for enlarged image on hover*/
visibility: visible;
top: 0;
left: 60px; /*position where enlarged image should offset horizontally */
}
to:
.thumbnail:hover span{ /*CSS for enlarged image on hover*/
position:fixed; /* <--added for Firefox/Mozilla
visibility: visible;
top: 0;
left: 60px; /*position where enlarged image should offset horizontally */
}
and adding this in the head of the html document:
<!--[if IE]>
<style type="text/css">
.thumbnail:hover span{ /*CSS for enlarged image*/
position:absolute;
</style>
<![endif]-->
solved the problem. This has been tested in IE 5.5 and 6 on Win98 and XP and Mozilla and Firefox on Win98, XP and Mac OS X (also works in Safari). Other browsers should work as well, but I would welcome anyone with other browsers to test this and comment here. You may see my implementation of this at http://www.firstchurchofgodindependence.org
This may have been fixed in IE7, but I have an aversion to installing MS betas on my box. If anyone has IE7 installed, I would be interested in knowing if this hack causes any undesired effects. Of course the simple fix would be to replace [IF IE] with [IF<IE7] if IE7 is affected.
I want to have the hovered pop-up image open directly next to the link/thumb that activated it. I have not seen anyone ask about this or to offer a suggestion.
I really cannot use the offseting part of the script to get it to work.
Please help! Thanks in advance.
a possible solution I just found out is to set:
.thumbnail:hover span{ /*CSS for enlarged image on hover*/
visibility: visible;
top: auto;
left: auto; /*position where enlarged image should offset horizontally */
So, change the 0 and 60px value to auto and auto. That will open the hovered image RIGHT next to the thumb. I still have not found a way to open it next to the thumb but, say, 10-15 pixels to the right.
ANY thoughts on this? Reply ahead... Thanks.
Very elegant script and your last fix is exactly what we’re looking for. If you want to see life site with your script implementation then visit www.amray.com web directory, go to any category and move mouse over thumbs.
One request. Can you come up with drop shadow for popup images?
Thanks again







bugs fixed :
http://www.sevoir.hu/gallery2.zip
join it ;-)
thx a lot for css drive, for 1st script !