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 16 of 53 pages « First < 14 15 16 17 18 > Last »
but is there anyway to avoid loading the larger image when the page loads ?
i mean the larger image loads when it is hovered.
ImageUrl='<%# eval("Image01") %>'
How do I get the <a href="#thumb" to live happily with ImageURL in my datalist?
<td><a class="thumbnail" href="#thumb"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="148" height="22">
<embed src="tips.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="148" height="22"></embed></object><span><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="148" height="22">
<embed src="tips1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="148" height="22"></embed></object>
<a class="thumbnail" href="#thumb">
<asp:Image ID="Image2"
CssClass="thumbnail"
runat="server"
EnableViewState="true"
AlternateText="Salvage"
ImageUrl='<%# eval("Image01") %>'
Width="60px"
Height="80px"
BorderStyle="Solid"
BorderWidth="1px"
style="left: 0px; top: 1px"
BorderColor="SaddleBrown" >
<span>
$ <%# eval("Price", "{0:C}") %>
<%#eval("Image02")% >
</span>
</a>
To set a definate position for a gallery of images (say, 10 thumbs across, and 3 thumbs deep) to open all of their enlarged images in the same place (like the center of the page)... add
position:fixed;
just below
.thumbnail:hover span{ /*CSS for enlarged image on hover*/
and above
visibility: visible;
top: 0;
left: 250px; /*position where enlarged image should offset horizontally */
}
You can see that I changed left: 60pix to 250.. that is because I have a 700px Iframe that my gallery is loading in. This lets my 200px wide image load in the center of the iframe.
_________________________
I have seen this posted 2 times, but not addressed.. is there a way to make the enlarged image disappear when your mouse leaves the thumbnail? Rather than staying open with the mouse over the enlarged image? It's kind of a pain to have to run your mouse to the top/bottom/side of the page each time to get the popup image to disappear.
Comment Pages 16 of 53 pages « First < 14 15 16 17 18 > Last »
Commenting is not available in this weblog entry.






