SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Hide Hyperlink Focus
-
Mar 20, 2007, 20:36 #1
- Join Date
- Nov 2005
- Location
- Columbia, Missouri
- Posts
- 99
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hide Hyperlink Focus
Is there a way to hide the link focus onmousedown using JavaScript or CSS? Specially in Firefox.
Thanks,
-
Mar 20, 2007, 21:57 #2
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes... Why would you want to disable an accessibility feature that your users may rely on?
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Mar 20, 2007, 22:15 #3
- Join Date
- Jun 2004
- Location
- Mumbai, India
- Posts
- 541
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can you please give some more details exactly what you are asking for....
Vikrant Korde
S Y S T I M E, Mhape,
Mumbai, Maharashtra, India.
-
Mar 21, 2007, 05:38 #4
- Join Date
- Mar 2006
- Location
- Sweden
- Posts
- 451
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:var links = document.getElementsByTagName( 'a' ); for( var i = 0, l = links.length; i < l; i++ ) { links[i].onfocus = function() { this.blur(); } }
-
Mar 21, 2007, 09:57 #5
- Join Date
- Nov 2005
- Location
- Columbia, Missouri
- Posts
- 99
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks, the only reason I wanted to hide the focus is because I have created CSS tabs, the tabs are 160x40px, but when the user clicks on the tab, the focus covers an area of 160x60, it just looks annoying.
Thanks for the help.
-
Mar 21, 2007, 15:40 #6
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There is a better way. Using blur() to do it disables keyboard navigation which is an extremely bad idea.
Make sure that the links have a :focus state defined and then you can use this:
Code:#nav a { outline: 0 none; }
We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
Bookmarks