View Full Version : Links
ragol_67
11-11-2002, 03:55 AM
When you click a link on a webpage, there is that dotted line that goes around the text or picture that you are clicking.
Is there a script that takes that dotted line away, so when you click the link it doesn't appear at all?
cg9com
11-11-2002, 04:45 AM
dotted line around it?
im not sure what you are saying there.
but to remove link underlines you can do the following.
<style type="text/css">
a {text-decoration:none}
</style>
to remove borders around link images this can be applied
<a href="#"><img border="0" src=""></a>
glenngv
11-11-2002, 07:38 AM
that dotted line signifies focus to that anchor link.
you can remove it by putting
onfocus="this.blur()"
in each of your links, but you can just do it like this:
function blurLinks(){
for(var i=0 ; i < document.links.length ; i++)
document.links[i].onfocus=blurIt;
}
function blurIt() {
if (this.blur) this.blur();
}
window.onload=blurLinks;
that will disable focus in all your links but of course, you can still click it. Be aware though that users will not be able to tab to these links.
p.s.
if you have already an onload event handler, just call blurLinks() function to the function being called by onload.
ragol_67
11-11-2002, 11:49 PM
Thanks Glenn!
What do you mean by "tab to the link"?
Oh ya, and also, (not to sound retarded) but where to I place that code in my page?
(ex; head, body etc..) and what type of tags do I place around it?
Thanks.
whammy
11-12-2002, 12:09 AM
IMHO, I would only use onfocus="this.blur()" in the links which you are concerned about the appearance of.
Otherwise (at least when dealing with forms), you might make people who are familiar with tabbing through stuff quickly very annoyed.
What he means by "tab to the link" is this... go to any website, and just hit your tab key over and over... you'll notice it will go from one link to the next... this is also VERY handy in forms. ;)
glenngv
11-12-2002, 12:51 AM
put that inside the head tag
<head>
<script language="javascript">
function blurLinks(){
for(var i=0 ; i < document.links.length ; i++)
document.links[i].onfocus=blurIt;
}
function blurIt() {
if (this.blur) this.blur();
}
window.onload=blurLinks;
</script>
</head>
ragol_67
12-15-2002, 05:06 AM
Is it possible to have an option at the bottom of the page, that says click here to enable tabbing?
Or would that require making 2 seperate pages. 1 with tabbing and one without?
chrismiceli
12-15-2002, 05:15 AM
<script language="javascript">
function blurLinks(){
for(var i=0 ; i < document.links.length ; i++)
document.links[i].onfocus = "";
}
</script>
Roy Sinclair
12-16-2002, 10:22 PM
Warning!
If you expect to serve disabled people from your web site, do not, I repeat do not use this blurring function. The use of that function makes it impossible for people with certain types of disabilities to navigate your web page.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.