Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"hidefocus" possible for hotspot polygonal areas in image maps? 1

Status
Not open for further replies.

jhherring

Programmer
Jun 18, 2002
33
US
I've used hidefocus=&quot;true&quot; within the <a> tag to keep the dotted rectangle from showing up around the thing that's acting as the link. So far, so good. No problems. Then, along comes the need to use an image map. I've got my polygonal areas defined, I've got my JavaScripts triggering, and everybody's happy, but to make it even more perfect, I'd like to be able to hide the outline of the polygonal area when it's clicked on -- it's an awkward shape, and it's much too persistent. Is there a way to suppress the outline of the hotspot? I can't find any such thing mentioned in any of my usual resources.

Thanks for any help.

John Herring
jhherring@yahoo.com

 
It's the first time I hear about &quot;hidefocus&quot; thing. Where did you test it?
The one that is commonly used is this:
[tt]
onfocus=&quot;this.blur()&quot;
[/tt]
It can be used for anything: <a> links, imagemap areas, etc. and it works in all browsers.

Also, I don't see anything horrible if the outline is visible. Why should you hide it?
More than that, it is seen only in IE (all versions) and Netscape 6 and is not seen in any Opera and NN4.
 
Strange. I would have sworn I had marked this thread, but no e-mail was sent alerting me to your reply. Well, it's marked now. At any rate, thanks for replying, and I'll be testing your suggestion shortly, perhaps today, perhaps Monday.

As for the hidefocus=&quot;true&quot; -- I don't remember where I picked that up, but it works just fine in IE 5.0+ (Win) at least. Just pop it into your <a> tag somewhere and watch the focus NOT appear around the image or text that serves as the link, when you click it. Really cool when that's what's needed.

Yes, I know all about the &quot;right&quot; way to do things, like we're not supposed to remove or suppress the visual indicator of where the focus is, but there are times when the situation calls for specific effects. This is one of those times. Since the hidefocus thing DOES work, and since I'm aware of the trade-offs between achieving the esthetic goal and usability, I feel entitled to use it if I want to.

>>> It's the first time I hear about &quot;hidefocus&quot; thing.
>>> Where did you test it?

I use it all the time, but the two most prevalent places I've used it I cannot yet show to the world -- both are confidential until they're unveiled. Sorry. But you can quickly and easily try it out in your own code.

>>> The one that is commonly used is this:

>>> onfocus=&quot;this.blur()&quot;

Wouldn't this have the effect of preventing the element from ever getting the focus long enough to act on it? Like as soon as the object gets the focus it loses it? Seems almost self-contradictory. But hey, I'll try anything once.

>>> It can be used for anything: <a> links, imagemap
>>> areas, etc. and it works in all browsers.

Well, that's what I need. I'll give it a try and get back to you here.

>>> Also, I don't see anything horrible if the
>>> outline is visible. Why should you hide it?

Depends on the situation. The shape is an odd shape, and since the color of the image map in that spot is a bright blue, the color of the outline of the hotspot is, of course, a contrasting color that calls attention to itself. More than that, the outline is persistent, too persistent, even after you've clicked on it and gone to the target page. Since the target page, in this case, loads into another frame, and the image map remains visible in the top frame, nothing happens to the image map and the outline stays visible. This can divert the user's attention away from what he/she &quot;should&quot; be looking at.

The outline of the polygonal hotspot is a solid, colored line, not the gray dotted line that indicates focus in all situations other than image maps. I find it highly noticeable.

>>> More than that, it is seen only in IE
>>> (all versions) and Netscape 6 and is not
>>> seen in any Opera and NN4.

Well, it's good to know that it's not persistent everywhere, but since I'm building this site specifically for IE users (per corporate policy), it's the behavior in IE that concerns me most.

At any rate, thanks again for the reply. I'll be testing your code soon, and will report the results.

John Herring
jhherring@yahoo.com

 
It works! Brilliant! Thanks!

John Herring
jhherring@yahoo.com


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top