Hello and welcome to beautiful Jun Blog.

去掉链接时虚线框的几个方法

1.直接给链接加是onfocus=”this.blur()”.

<a href=”#” onfocus=”this.blur()”>链接</a>

2.CSS实现

a{blr:expression(this.onFocus=this.close());} /* 只支持IE,过多使用效率低 */

a{blr:expression(this.onFocus=this.blur());} /* 只支持IE,过多使用效率低 */

a:focus { -moz-outline-style: none; } /* IE不支持 */

3..htc实现IE支持

<public:attach event=”onfocus” onevent=”hscfsy()”/>

<script language=”javascript”>

function hscfsy(){

this.blur();

}

</script>

调用 a {behavior:url(htc文件所在路径地址)}

4.通过JavaScript遍历实现

window.onload=function()

{

for(var ii=0; ii document.links$[$ii$]$.onfocus=function(){this.blur()}

}

5.对WordPress可以用内部的JQuery框架来去除

$(“a”).bind(“focus”,function(){

if(this.blur){

this.blur();

}

});

转自:http://leotheme.cn/javascript/quediaolinksdesxk.html

Posted on 23 六月 '10 by admin, under CSS.