去掉链接的虚线

当点击一个链接的时候,总会出现一个虚线框。几种去除的方法:
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){ //如果支持 this.blur
  3. this.blur();
  4. }
  5. });

你可能感兴趣的:(JavaScript,jquery,IE,wordpress,HTC)