Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 705

Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 707

Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 705

Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 707

Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 705

Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 707

Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 705

Warning: Trying to access array offset on value of type bool in /home/grailgod/ozoneasylum.com/libraries/ubblib_1.php on line 707

Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
DHTML/JavaScript

How do I get rid of that rectangle when I click on a link? Differences Pages that link to <a href="https://ozoneasylum.com/backlink?for=5031" title="Pages that link to How do I get rid of that rectangle when I click on a link? Differences" rel="nofollow" >How do I get rid of that rectangle when I click on a link? Differences\

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, &#91;url=http://www.maxworld.co.yu&#93;http://www.maxworld.co.yu&#91;/url&#93;

function removeFocus() {
    for (i = 0; i < document.links.length; i++) {
+        document.links[i].onclick = document.links[i].blur;

-        document.links&#91;i&#93;.onclick = document.links&#91;i&#93;.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.


-----------------------
Relevant threads:

global script to kill link dots in IE

How do I make an anchor image not seem selected?

Getting rid of the......

ie onClick image highlight

No link selections in IE

______________________
Emperor

(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)

« BackwardsOnwards »

Show Forum Drop Down Menu