等待-放飞梦想

勤现在-乐将来

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

Await / 前端交互 / 2008/08/15 4:17 / 热度(6,020)

我想很多朋友都遇到这个问题,当点击一个链接的时候,总会出现一个虚线框。
在这介绍几种去除的方法:
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框架来去除

  1. $("a").bind("focus",function(){
  2. if(this.blur){ 
  3. this.blur();
  4. }
  5. });

评论(5)

  1. 可咔酷
    2010/08/12

    不知道博主用的哪种方法 能介绍下吗

    • Await
      2010/08/12

      我用的最后一种。

  2. HillBoy
    2010/02/23

    5.对WordPress可以用内部的JQuery框架来去除
    能否详细说明呢?

  3. 吓我一跳
    2009/11/14

    写的这么好怎么没人留言呢

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Top 管理

无觅相关文章插件,快速提升流量