Log in

View Full Version : CSS Popup image viewer on Reactive zone



picou222
02-10-2007, 05:16 PM
I tried to use the CSS Popup image viewer on a map to enlarge different part of the image. To do this, I added map areas to my image.

Instead of showing the mapped area, the popup raise as soon as I bring the mouse over the image.

I coded only one area for the time beeng, I will code the other area when this one will be working.
See the page at:
http://sites.rapidus.net/ccournoy/data/projet.htm
Here is my html code :

<a class="thumbnail"><img alt="" src="images/carte_terrains.gif" usemap="#terrain" />
<map name="terrain" id="terrain">
<area shape="poly" coords="199,89,226,103,249,70,215,64" href="#" alt="terrain_55" /></map>
<span><img src="images/terrain-55.gif" /><br />Superficie 25000 pi2</span></a>

CSS code

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

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

.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: lightyellow;
padding: 5px;
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: 0;
left: 120px; /*position where enlarged image should offset horizontally */
}

Thanks for helping