Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Image Map Coordinates for different browsers...

    How do I created an image map that will work on all browsers?

    This code (within define_main_page) works only with Firefox. It does not work with IE and Chrome, since they shrink the image relative to Firefox and therefore the map coordinates are no longer valid.

    Is there a way to make the coordinates relative to the size of the image?

    Code:
    <style type="text/css">
    div.home
    img {
    width:66em;
    }
    </style>
    
    <div class="home">
    <img border="0" usemap="#Map" src="images/home.jpg" /> 
    <map name="Map"> 
      <area href="Link 1" coords="0,13,275,188" shape="rect" />
      <area href="Link 2" coords="310,12,530,187" shape="rect" />
      <area href="Link 3" coords="560,12,700,187" shape="rect" />
      <area href="Link 4" coords="715,12,860,187" shape="rect" />
    </map>
    </div>
    Thank you!

  2. #2
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    541
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Define the width and the height of your image and it wont be shrunk by other browsers.

    Code:
    <style type="text/css">
    div.home
    img {
    width:66em;
    }
    </style>
    
    <div class="home">
    <img border="0" width="200px" height="200px" usemap="#Map" src="images/home.jpg" /> 
    <map name="Map"> 
      <area href="Link 1" coords="0,13,275,188" shape="rect" />
      <area href="Link 2" coords="310,12,530,187" shape="rect" />
      <area href="Link 3" coords="560,12,700,187" shape="rect" />
      <area href="Link 4" coords="715,12,860,187" shape="rect" />
    </map>
    </div>

  3. #3
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Genius!

    Thanks Tino!

  4. #4
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Well, somehow that still does not work.

    I mapped the coordinates on the original image.

    Here is the site:
    http://www.saleyla.com

    I did not include height because it stretches the image vertically.

    Ideas?

    Thank you.

  5. #5
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Unless there is a solution with the current html code, maybe I should do the maps in CSS, using em for coordinates?

  6. #6
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    I did the maps in CSS with em coordinates and they appear consistent on all browsers, however somehow I cannot get the image to show up. I have a test page here:
    http://www.saleyla.com/store/index.p...age=page&id=27

    It must be something trivial that I cannot see.

    Ideas?

    Thank you.

  7. #7
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    So...
    With html the maps did not scale.
    With CSS the image is not scaling.

    Getting closer.

    Any kind help welcome. :)


    PS: Here is a simple tutorial for CSS image maps:
    http://css.flepstudio.org/en/css-tut...ap-in-css.html

  8. #8
    Join Date
    Nov 2007
    Location
    Melbourne, Australia
    Posts
    541
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    Just resize your image to the size that is displayed on your website. That is the easiest and reduces the filesize as well. Doesnt make a lot of sense to have a large image and display it small.

  9. #9
    Join Date
    Feb 2009
    Posts
    138
    Plugin Contributions
    0

    Default Re: Image Map Coordinates for different browsers...

    That would be nice, but it does not work. Why?

    Because if I size it for Firefox, it will spill over in IE and Chrome, and the maps will be off.

    If I resize it for IE, then it will be short in Firefox.

    Also, if I have a larger image, people can zoom up and the image will keep resolution.

    So unfortunately I have to figure out what's wrong with my CSS that is not allowing the image to resize.

    This is my current code:
    Code:
    #home_graphics_btm{
    width: 66em;
    height: 20em;
    background: url(../images/home_graphics_btm.jpg) no-repeat;
    display: block;
    margin-top: 400px;
    }
    #newsletter {
    float: left;
    position:absolute;
    width : 21em;
    height: 11em;
    margin-left: 0em;
    margin-top: .75em;
    }
    #specials { 
    float: left;
    position:absolute;
    width : 17em;
    height: 11em;
    margin-left: 23em;
    margin-top: .75em;
    }
    #shipping {
    float: left;
    position:absolute;
    width : 11em;
    height: 11em;
    margin-left: 42em;
    margin-top: .75em;
    }
    #shopping { 
    float: left;
    position:absolute;
    width : 11em;
    height: 11em;
    margin-left: 54em;
    margin-top: .75em;
    }
    Thank you.

 

 

Similar Threads

  1. Optimizing layout for different browsers
    By bodkin77 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 27 Jul 2013, 02:56 PM
  2. category specific css for different browsers
    By eVelt in forum Templates, Stylesheets, Page Layout
    Replies: 31
    Last Post: 18 Jul 2010, 09:51 PM
  3. Multiple stylesheets for different browsers!
    By Shotgun Front in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Apr 2008, 02:26 PM
  4. Switching templates for different browsers
    By Kent in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Apr 2008, 09:49 PM
  5. EZ-Pages Background Image different in different browsers
    By rvagrrl in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 5 Aug 2006, 07:19 AM

Posting Permissions

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