masoud
04-28-2008, 06:10 PM
I am trying to use CSS script in my image mapping to have the enlarged photos pop up instead of opening a new window.
I used the below script that I took from DD (http://www.dynamicdrive.com/style/csslibrary/item/css-popup-image-viewer/P80/) in the head and I don't think there is any thing wrong with this script. I think the problem is in the body (see below the head script) when I try to use coordinates to map the image.
<style type="text/css">
.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: 60px; /*position where enlarged image should offset horizontally */
}
</style>
And below is the script that I wrote to map my image.
<body>
<IMG NAME="Frame" SRC="_Frame.jpg" WIDTH="500" HEIGHT="732" BORDER="2" USEMAP="#Frame">
<map name="Frame">
<a class ="thumbnail" href="#thumb"><area shape="rect" COORDS="96, 13, 393, 69" HREF="490042XX.jpg"><span>
<img src="490042XX.jpg" width="320" height="240" /><br />490042XX</span></a>
</map>
</body>
I used the below script that I took from DD (http://www.dynamicdrive.com/style/csslibrary/item/css-popup-image-viewer/P80/) in the head and I don't think there is any thing wrong with this script. I think the problem is in the body (see below the head script) when I try to use coordinates to map the image.
<style type="text/css">
.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: 60px; /*position where enlarged image should offset horizontally */
}
</style>
And below is the script that I wrote to map my image.
<body>
<IMG NAME="Frame" SRC="_Frame.jpg" WIDTH="500" HEIGHT="732" BORDER="2" USEMAP="#Frame">
<map name="Frame">
<a class ="thumbnail" href="#thumb"><area shape="rect" COORDS="96, 13, 393, 69" HREF="490042XX.jpg"><span>
<img src="490042XX.jpg" width="320" height="240" /><br />490042XX</span></a>
</map>
</body>