去掉点击链接时出现的虚线框的几个方法

去掉点击链接时出现的虚线框的几个方法,第1张

去掉点击链接时出现的虚线框的几个方法 在这介绍几种去除的方法:

直接给链接加是
onfocus=”this.blur()”.
<a href="#" onfocus="this.blur()">链接</a>

CSS实现

复制代码代码如下:
a{blr:expression(this.onFocus=this.close());} /* 只支持IE,过多使用效率低 */
a{blr:expression(this.onFocus=this.blur());} /* 只支持IE,过多使用效率低 */
a:focus { -moz-outline-style: none; } /* IE不支持 */

htc实现IE支持

复制代码代码如下:
<public:attach event="onfocus" onevent="hscfsy()"/>
<script language="javascript">
function hscfsy(){
this.blur();
}
</script>

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

通过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
this.blur();
}
});

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/620427.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-15
下一篇 2022-04-15

发表评论

登录后才能评论

评论列表(0条)

保存