语法:

nav-rightauto | <id> [ current | root | <target-name> ]? | inherit

相关属性nav-index , nav-up , nav-right , nav-down

取值:

auto:
User Agent默认的顺序。
<id> :
要切换元素的id命名。
root | <target-name>:
这个参数不能以”_”命名,指出frameset目标页面之间的元素焦点切换。如果指定的目标页面不存在,则被视为当前页面的焦点,意味着完全依赖框架页。该属性是以关键节点" root " 标示,User agent将把整个frameset框架页定为目标。
inherit:
默认继承。

说明:

输入设备默认四个方向键按html文档顺序顺序来控制元素的焦点切换,但为了更好的用户体验,User agents提供了自定义切换焦点的控制顺序方向。

兼容性:

类型 IEInternet Explorer FirefoxFirefox ChromeChrome OperaOpera SafariSafari
版本 (√)IE6 (×)Firefox 2.0 (√)Chrome 1.0.x (√)Opera 9.63 (√)Safari 3.1
(√)IE7 (√)Firefox 3.0 (√)Chrome 2.0.x (√)Safari 4Public beta
(√)IE8 (√)Firefox 3.5

示例:

    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>nav_相关属性测试</title>
</head>
<style>
button { position:absolute; }

button#b1 {
	top:0; left:50%;
	nav-index:1;nav-right:#b2; nav-left:#b4;nav-down:#b2; nav-up:#b4;
}
button#b2 {
	top:50%; left:100%;
	nav-index:2;nav-right:#b3; nav-left:#b1;nav-down:#b3; nav-up:#b1;
}
button#b3 {
	top:100%; left:50%;
	nav-index:3;nav-right:#b4; nav-left:#b2;nav-down:#b4; nav-up:#b2;
}
button#b4 {
	top:50%; left:0;
	nav-index:4;nav-right:#b1; nav-left:#b3;nav-down:#b1; nav-up:#b3;
}
</style>
<body>
	<button id="b1">BT1</button>
	<button id="b2">BT2</button>
	<button id="b3">BT3</button>
	<button id="b4">BT4</button>
</body>
</html>

 

快速跳转