Results 1 to 3 of 3

Thread: CSS image mapping

  1. #1
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default CSS image mapping

    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/cs...ge-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.

    Code:
    <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.
    Code:
    <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>
    Last edited by jscheuer1; 04-29-2008 at 06:09 AM. Reason: add code tags

  2. #2
    Join Date
    Feb 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I would appreciate any help please.
    Thank you

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Please post a link to the page on your site that contains the problematic code so we can check it out.


    That said, image maps are such a unique sort of way of organizing links on a page, in that different browsers treat them quite differently. The area tags do not behave like standard elements as far as css style or the DOM goes. This makes them difficult (sometimes even impossible) to work with using css or javascript. An image map is generally best employed as a thing in itself and just dropped into the page where you want it to be and then left alone. The image in the map can often be easily manipulated, but the map part will not always follow suit.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. The Following User Says Thank You to jscheuer1 For This Useful Post:

    masoud (04-29-2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •