[ 来源: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.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)