[Home]Dotted box on a linked image

HomePage | RecentChanges | Preferences | Newbie Help

Category HTML FAQ -:- [Category JavaScript FAQ]?

Phil Hayz sez:

See http://www.leftcorner.com/designtools/dsp_main.cfm?DesignToolID=8

<a href="blah.html" onfocus="this.blur();">Link</a>

Anonymous: "This technique impairs usability as one can not tab through links and form elements. If your site is geared towards all audiences, this technique is not recommended. Instead use onClick="this.blur();". This removes the outline on IE 4 and 5 on Windows machines only while keeping usabilty intact."

Jerry Muelver: Additional note: blur() is a functional call but to a built-in JS function (Technically speaking it's a method belonging to the document class - Joe Alexander). It's a sister function with focus(). From _JavaScript: The Definitive Guide_ by David Flanagan (O'Reilly books)-- "The focus() qnd blur() methods also provide high-level control over a window. Calling focus() requests that the system give the keyboard focus to the window and blur() relinquishes keyboard focus." Phil's code removes the focus as soon as focus is detected. No focus, no rectangle.

Jukka Korpela 17 May 2001 on alt.html: ... it's better than onfocus. Quoting my own http://www.malibutelecom.com/yucca/www/links.html#selrect :

"The following fundamental problem still remains: after following a link and returning to the page, the user cannot conveniently proceed by tabbing. Since the focus was deliberately lost, he has start over, from the beginning, not where he was. The point is that blur() doesn't just remove the dotted line; it removes the focus itself, not just its visual indication."

The bottom line is that attempts to remove the "hotspot line" are based on a misunderstanding: when successful, they remove a vital usability feature and, as a side effect, mess up keyboard navigation.

Comments --
HomePage | RecentChanges | Preferences | Newbie Help
This page is read-only | View other revisions
Last edited May 24, 2001 7:14 am (diff)

This FAQ is happily hosted by Betadome Digital Media