Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2835
  • Last Modified:

How can i remove the outline of an image map's area tag in Firefox?

I've implemented an image map as follows -

<map id="map1">
    <area shape="poly" coords="355,176,385,134,399,134" href="#" onfocus="this.blur();" />
    .....
</map>

When clicking w/in the area on the image, the area becomes outlined.  In IE 6 and 7, this.blur() moves focus off the area and removes the outline.  In FireFox 2 and 3, not only does that not happen, but even clicking another area leaves the original still surrounded by the outline (my map has 7 large areas, so this gets really ugly after a few clicks).  I seem to remember having had luck using the 'outline' CSS style w/ FireFox in the past to force borders to not show up, but that doesn't seem to be working in this instance (something to do with using poly, perhaps?).

Any ideas how I can remove the outline across both browsers?
0
dj_user1
Asked:
dj_user1
  • 4
  • 4
  • 2
1 Solution
 
Pawel WitkowskiSenior Javascript DeveloperCommented:
just set style="border:0px"

try on image, map, areashape until you get what you need (probably on image)
0
 
lpxtechCommented:
Hi,

There is a css property outline: none;

Try border: none; outline: none;

Hope this helps. :-)
0
 
Pawel WitkowskiSenior Javascript DeveloperCommented:
border: 0 or border: none should do the work :)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
dj_user1Author Commented:
Hello and thanks for the quick responses.  

I've tried (and just tried again, for good measure) both border:0px; and outline:none; to no avail.  I stuck both values in a style tag on the image that's using the map, the area tags, and the map tag.  Still have these remnant outlines.  See attached image.  This is after I've clicked everything.
CropperCapture-2-.jpg
0
 
lpxtechCommented:
Try: outline-style: none; as well.
0
 
Pawel WitkowskiSenior Javascript DeveloperCommented:
can you give a little code ? or a link to page ? that would help alot ;)
0
 
dj_user1Author Commented:
No problem.  Here's a test html page using some random map image.  Areas don't line up w/ the continents, but the effect is there.
<html>
<head>
</head>
<body>
 
 
<img src="http://www.susqu.edu/study_abroad/Images/world_map.gif" usemap="#worldMap" border="0" />
 
<map id="imgMap" name="worldMap">
 <area shape="poly" coords="355,176,385,134,399,134,409,157,386,185,375,169,349,173" alt="Australia" href="#" onfocus="this.blur();" />
 <area shape="poly" coords="283,74,305,41,347,45,343,40,342,35,348,35,369,44,366,51,382,47,385,62,402,127,432,172,435,187,411,203,405,188,428,176,399,128,380,125,348,140,329,114,327,87,306,107,278,75" alt="Asia/Pac" href="#" onfocus="this.blur();" />
 <area shape="poly" coords="184,64,188,22,263,0,356,2,410,18,372,52,372,43,346,32,331,38,306,39,296,38,279,33,258,52,245,49,232,33,233,49,226,63,212,61,180,62" alt="Europe" href="#" onfocus="this.blur();" />
 <area shape="poly" coords="223,102,209,113,193,111,218,96,229,83,248,85,255,95,278,91,278,81,257,65,257,53,241,50,232,54,226,77" alt="Middle East/Africa" href="#" onfocus="this.blur();" />
 <area shape="poly" coords="1,27,34,5,69,5,99,0,148,0,128,21,131,44,85,79,76,78,55,78,31,68,26,56,25,31,0,37" alt="North America" href="#" onfocus="this.blur();" />
 <area shape="poly" coords="117,207,157,126,38,70,46,96,66,99,75,130,86,153,97,200,112,205" alt="South America" href="#" onfocus="this.blur();" />
</map>
 
</body>
</html>

Open in new window

0
 
dj_user1Author Commented:
If it helps, I'm currently looking at this in Firefox 3.0.3.
0
 
Pawel WitkowskiSenior Javascript DeveloperCommented:
I just deleted onfocus event  o_O
<html>
<head>
</head>
<body>
 <map id="imgMap" name="worldMap">
 <area shape="poly" coords="355,176,385,134,399,134,409,157,386,185,375,169,349,173" alt="Australia" href="#"  >
 <area shape="poly" coords="283,74,305,41,347,45,343,40,342,35,348,35,369,44,366,51,382,47,385,62,402,127,432,172,435,187,411,203,405,188,428,176,399,128,380,125,348,140,329,114,327,87,306,107,278,75" alt="Asia/Pac" href="#"  >
 <area shape="poly" coords="184,64,188,22,263,0,356,2,410,18,372,52,372,43,346,32,331,38,306,39,296,38,279,33,258,52,245,49,232,33,233,49,226,63,212,61,180,62" alt="Europe" href="#"  >
 <area shape="poly" coords="223,102,209,113,193,111,218,96,229,83,248,85,255,95,278,91,278,81,257,65,257,53,241,50,232,54,226,77" alt="Middle East/Africa" href="#"  >
 <area shape="poly" coords="1,27,34,5,69,5,99,0,148,0,128,21,131,44,85,79,76,78,55,78,31,68,26,56,25,31,0,37" alt="North America" href="#"  >
 <area shape="poly" coords="117,207,157,126,38,70,46,96,66,99,75,130,86,153,97,200,112,205" alt="South America" href="#"  >
</map>
 
<img src="http://www.susqu.edu/study_abroad/Images/world_map.gif" usemap="#worldMap" border="0" />
 
 
 
</body>
</html>

Open in new window

0
 
dj_user1Author Commented:
hah... perfect.  if(document.all)this.blur(); takes care of it in both browsers.

Thanks much!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now