It can be annoying when IE leaves that rectangular highlight on your links, especially when they are graphics, but thanks to mr.maX there is a solution.
Add this to the head:
code:
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!-- ;
+// Written by mr.maX, http://www.maxworld.co.yu-// Written by mr.maX, [url=http://www.maxworld.co.yu]http://www.maxworld.co.yu[/url]
function removeFocus() {
for (i = 0; i < document.links.length; i++) {
+ document.links[i].onclick = document.links[i].blur;
- document.links[i].onclick = document.links[i].blur;
}
}
// -->
</script>
and change the body attributes:
code:
<BODY ONLOAD="removeFocus()">
This will kill the rectangle when the page is loaded.
There is another script that removes the rectangle when the focus falls on a link, but it causes problems for those who use TAB to navigate through a page and can cause problems with drop down menus (it is in the first link for those interested).
This is a variation on the original script because it used onfocus instead of onclick. The disadvantage is that the rectangle will be visible between the time the mouse button goes down and comes back up, but the page will be navigatable with the keyboard.
-----------------------
In Mozilla, this can be used in the CSS:
code:
-moz-outline: none;
Also, in IE you can use an expression like this:
code:
a {
selector-dummy: expression(this.hideFocus=true);
}
None of these proprietary CSS styles will validate, though.
(Added by: Emperor on Sun 26-May-2002) (Edited by: Slime on Sun 26-May-2002) (Edited by: Emperor on Sun 26-May-2002) (Edited by: Tyberius Prime on Sun 26-May-2002) (Edited by: Emperor on Mon 28-Oct-2002) (Edited by: HZR on Wed 30-Oct-2002) (Edited by: Rinswind 2th on Thu 08-May-2003) (Edited by: marty on Sun 07-Sep-2003) +(Edited by kuckus on 09-07-2004 21:47) -(Edited by kuckus on 09-07-2004 21:45)