I’ve gotten a couple E-mails from visitors asking me how I do the photo pop-ups in the (incomplete) Photos section. Here’s a short explanation; maybe I’ll write up a tutorial later if there’s enough demand.
The pop-up photo relies on CSS2 positioning. Look carefully at photos.css. You’ll notice the full-size photo is a heavily-styled <span> inside the <a> that contains the thumbnail. The <span> changes style when you float the mouse over the <a>, by using the CSS2 declaration “a:hover span“. When not hovered over, the <span> tag has the CSS attribute “display: none” so it’s invisible. When hovered over, the span has attribute “display: block” so it’s displayed. Voilà!
Furthermore, I use the thumbnail as the original image inside the <span>, and then use Javascript to replace the thumbnail with the full-resolution image when the mouse hovers over the thumbnail. This is so the browser doesn’t load all the full-resolution images when the page loads. It also results in a neat “progressive download” effect when you first download the image over a slower network connection.
The CSS2 “popup” feature works perfectly with Internet Explorer 5.x and 6.x, works okay (occasional refresh glitches) with Netscape 6, and not at all (no popup) with Opera–which is why it’s important that the thumbnail is a shortcut to the full-res image.
![[Vlad's office, redecorated]](/images/Vlad.jpg)