Get rid of links dotted line comprehensive Analysis summary

Source: Internet
Author: User
Link

The traditional method, in the tag with more attribute code, difficult to modify

<a href= "link1.htm" >link1</a>

<a href= "link1.htm" >link1</a>

<a href= "link1.htm" hidefocus= "true" >link1</a>

<a href= "link1.htm" hidefocus= "Hidefocus" >link1</a>

<a href= "link1.htm" hidefocus>link1</a> non-standard

Intermediate approach, global control 

CSS implementation increases IE burden, does not recommend the use of

A{blr:expression (This.onfocus=this.close ());}

A{blr:expression (This.onfocus=this.blur ());}

HTC implementation IE support, and there are delays, not recommended

Save the following code as a file with the. HTC name extension

<public:attach event= "onfocus" onevent= "Hscfsy ()"/>
<script language= "JavaScript" >
function Hscfsy () {
This.blur ();
}
</script>

Style call

A {Behavior:url (the path address of the HTC File)}

Advanced approach, Global control

Traversal implementation

Window.onload=function ()
{
for (var ii=0; ii<document.links.length; ii++)
Document.links[ii].onfocus=function () {This.blur ()}
}

Encapsulate it as a function

function Fhidefocus (tname) {
Atag=document.getelementsbytagname (Tname);
for (i=0;i<atag.length;i++) atag[i].hidefocus=true;
for (i=0;i<atag.length;i++) atag[i].onfocus=function () {This.blur ();};
}

The current is to add a Hidefocus attribute, comment out the sentence is added Onfucus=this.blur ();
Then call Fhidefocus ("a") and remove the dotted box of a
By passing different parameters, you can remove more dashed boxes, such as "button" to remove the button
But keep in mind that the arguments are in uppercase

Application Skills and questions

A. Map area Links How do I eliminate link dashes?

This is an erroneous idea, in fact, should be controlled in the picture of the map, rather than in the area, refer to the traditional method

B. About onfocus

<a href= "http://blog.csdn.net/alonesword/" >

</a>

Among them, onfocus is set mouse Focus event things, this can be used, but also can not use, but in order to allow more browser recognition, recommended; border=0 this is the key to removing the dotted box (see some people on the internet with onfocus= "This.blur ()" To eliminate the dotted box, but in a local test, this sentence cannot be eliminated.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.