Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > NZ Computing > HTML image map

Reply
Thread Tools

HTML image map

 
 
Rob J
Guest
Posts: n/a
 
      12-10-2005
I have a site I decided to put an image map into to handle an image with
different areas linking to different places.

With the image map included in the source file it works fine but I
figured it would be easier to put the image map into another file so it
only has to be changed in one place if the links or image are changed.

This is supposed to work with <img src="..." usemap="file.html#mapname">
And the file contains

<map name="mapname">
<area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
"http://somesite/">
<area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
"http://somesite/">
<area name="NZD" shape = "rect" coords = "480,18,719,46" href =
"http://somesite/">
<area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
"http://somesite/">
</map>

Except it doesn't work. Firefox shows the image is linkable but nothing
happens when you click on any part of it.

Does the file with the map in it have to be in any specific format e.g.
full HTML format?

I tried this also
usemap="/path/to/map.html"
which should work?
 
Reply With Quote
 
 
 
 
Rob J
Guest
Posts: n/a
 
      12-10-2005
In article <(E-Mail Removed)> ,
http://www.velocityreviews.com/forums/(E-Mail Removed)am says...
> I have a site I decided to put an image map into to handle an image with
> different areas linking to different places.
>
> With the image map included in the source file it works fine but I
> figured it would be easier to put the image map into another file so it
> only has to be changed in one place if the links or image are changed.
>
> This is supposed to work with <img src="..." usemap="file.html#mapname">
> And the file contains
>
> <map name="mapname">
> <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
> "http://somesite/">
> <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
> "http://somesite/">
> <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
> "http://somesite/">
> <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
> "http://somesite/">
> </map>
>
> Except it doesn't work. Firefox shows the image is linkable but nothing
> happens when you click on any part of it.
>
> Does the file with the map in it have to be in any specific format e.g.
> full HTML format?
>
> I tried this also
> usemap="/path/to/map.html"

correction:
<img usemap="/path/to/map.html#mapname">

 
Reply With Quote
 
 
 
 
Mr Undeniably Sluttish
Guest
Posts: n/a
 
      12-10-2005
On Sat, 10 Dec 2005 19:48:30 +1300, Rob J wrote:

> I have a site I decided to put an image map into to handle an image with
> different areas linking to different places.
>
> With the image map included in the source file it works fine but I
> figured it would be easier to put the image map into another file so it
> only has to be changed in one place if the links or image are changed.
>
> This is supposed to work with <img src="..." usemap="file.html#mapname">
> And the file contains
>
> <map name="mapname">
> <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
> "http://somesite/">
> <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
> "http://somesite/">
> <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
> "http://somesite/">
> <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
> "http://somesite/">
> </map>
>
> Except it doesn't work. Firefox shows the image is linkable but nothing
> happens when you click on any part of it.
>
> Does the file with the map in it have to be in any specific format e.g.
> full HTML format?
>
> I tried this also
> usemap="/path/to/map.html"
> which should work?


Wouldn't it be easier to use a serverside include?


Undeniably Sluttish

--
Free software on every PC on every desk.

 
Reply With Quote
 
Enkidu
Guest
Posts: n/a
 
      12-10-2005
Rob J wrote:
> I have a site I decided to put an image map into to handle an image with
> different areas linking to different places.
>
> With the image map included in the source file it works fine but I
> figured it would be easier to put the image map into another file so it
> only has to be changed in one place if the links or image are changed.
>
> This is supposed to work with <img src="..." usemap="file.html#mapname">
> And the file contains
>
> <map name="mapname">
> <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
> "http://somesite/">
> <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
> "http://somesite/">
> <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
> "http://somesite/">
> <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
> "http://somesite/">
> </map>
>

One thing that I think is wrong is the usemap parameter. What you have
says 'look for the anchor 'mapname' in 'file.html'. If the mapfile is a
separate file called 'mapname' then it should be 'usemap=mapname' if
'mapname' is in that same directory. Or you could specify the relative
or absolute URL of the mapfile.

As to the contents of the file, I'm not sure, but that format doesn't
look familiar, but it's a long time since I used image maps.

Cheers,

Cliff
 
Reply With Quote
 
Shane
Guest
Posts: n/a
 
      12-12-2005
On Sat, 10 Dec 2005 20:58:07 +1300, Enkidu wrote:

> Rob J wrote:
>> I have a site I decided to put an image map into to handle an image with
>> different areas linking to different places.
>>
>> With the image map included in the source file it works fine but I
>> figured it would be easier to put the image map into another file so it
>> only has to be changed in one place if the links or image are changed.
>>
>> This is supposed to work with <img src="..." usemap="file.html#mapname">
>> And the file contains
>>
>> <map name="mapname">
>> <area name="RNZ" shape = "rect" coords = "0,18,239,46" href =
>> "http://somesite/">
>> <area name="NZRH" shape = "rect" coords = "240,18,479,46" href =
>> "http://somesite/">
>> <area name="NZD" shape = "rect" coords = "480,18,719,46" href =
>> "http://somesite/">
>> <area name="NZTV" shape = "rect" coords = "720,18,959,46" href =
>> "http://somesite/">
>> </map>
>>

> One thing that I think is wrong is the usemap parameter. What you have
> says 'look for the anchor 'mapname' in 'file.html'. If the mapfile is a
> separate file called 'mapname' then it should be 'usemap=mapname' if
> 'mapname' is in that same directory. Or you could specify the relative
> or absolute URL of the mapfile.
>
> As to the contents of the file, I'm not sure, but that format doesn't
> look familiar, but it's a long time since I used image maps.
>
> Cheers,
>
> Cliff


<map name="map">
<area alt="" shape="poly" coords="2,11,8,116,23,115,20,10"
href="#modern_operating_systems"
ONMOUSEOVER="update_sel_book(modern_operating_syst ems,this.href);" />
<area alt="" shape="rect" coords="64,13,76,115" href="#computer_networks"
ONMOUSEOVER="update_sel_book(computer_networks,thi s.href);" />


stolen from working example at
http://www.simtec.co.uk/appnotes/AN0017/
--
To be a kind of moral Unix, he touched the hem of Nature's shift.
-- Shelley

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript Image Viewer from Image Map Ryan Sullivan Javascript 3 11-24-2005 09:09 AM
displaying html content based upon Client Side image map coordinates RF Rohrer HTML 1 04-03-2005 07:05 AM
html to image or html to postcript to image Lukasz Indyk Python 4 05-17-2004 06:06 PM
ANN: USA HTML image map Gregory Vaughan HTML 8 01-18-2004 01:39 AM
image map link to show image underneath? Joe HTML 0 08-01-2003 05:18 PM



Advertisments