当前位置:首页>网络学院>网页制作>Javascript教程>文章内容

如何为链接除去虚点框

[ 来源:http://www.it55.com | 作者: | 时间:2007-08-16 | 收藏 | 推荐 ] 【

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hiding the Browsers Focus Borders. Should I, Shouldn’t I?</title>
<script language="JavaScript" type="text/JavaScript">
//add event function
function addEvent(obj, evType, fn){
 if (obj.addEventListener){
   obj.addEventListener(evType, fn, true);
   return true;
 } else if (obj.attachEvent){
   var r = obj.attachEvent("on"+evType, fn);
   return r;
 } else { 免费网页模版下载http://www.it55.com
   return false;
 }
}
// Find all link elements and add an onfocus attribte and value
function hideFocusBorders(){
var theahrefs = document.getElementsByTagName("a");
if (!theahrefs){return;}
for(var x=0;x!=theahrefs.length;x++){
theahrefs[x].onfocus = function stopLinkFocus(){this.hideFocus=true;};
}
}
//event added using the addEvent() function above
addEvent(window, 'load', hideFocusBorders);
</script>
<style type="text/css">
<!--
/* ----- hidden focus borders from mozilla ----- */
:focus { -moz-outline-style: none; }
-->
</style>
</head>
<body>
<p><a href="#">What is this?</a></p>
<p><a href="#"><img src="http://www.gulu77.com/images/gulu77.png" border="0" /></a></p>
</body>

免费资源http://www.it55.com

</html> 免费矢量图片素材下载http://www.it55.com

出处:

http://www.it55.com在线教程

http://www.cssplay.co.uk/menu/nodots.html#nogo3
http://codylindley.com/Javascript/223/hiding-the-browsers-focus-borders-should-i-shouldnt-i
http://sonspring.com/journal/removing-dotted-links IT资讯之家 http://www.it55.com

(编辑:IT资讯之家 www.it55.com

返回顶部
 

网友评论

[以下评论为网友观点,不代表本站。请自觉遵守互联网相关政策法规,所有连带责任均有评论者自负。]
[不超过250字]

图片文章