<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>2.11.JavaScript.多维数组</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
body{
background-color:#333;
padding:20px;
font:12px Verdana,Geneva,sans-serif;
}
ul{
list-style:none;
}
.nav{
height:30px;
}
.nav li{
float:left;
}
.nav li a{
text-decoration:none;
color:#fff;
height:30px;
line-height:30px;
padding:0 20px;
display:block;
}
.nav li a:hover{
color:#333;
-moz-border-radius: 20px; /* FF1+ */
-webkit-border-radius: 20px; /* Saf3+, Chrome */
border-radius: 20px;
-moz-box-shadow: 0px 0px 4px #ffffff; /* FF3.5+ */
-webkit-box-shadow: 0px 0px 4px #ffffff; /* Saf3.0+, Chrome */
box-shadow: 0px 0px 4px #ffffff; /* Opera 10.5, IE 9.0 */
background-image: -moz-linear-gradient(top, #eee, #666); /* FF3.6 */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #eee), color-stop(1, #666)); /* Saf4+, Chrome */
text-shadow:0 1px 0 #fff;
}
</style>
</head>
<body>
<script type="text/javascript">
/*
var arr = ["1","2","3",["4","5","6",["7","8","9"]]];
document.write(arr.length);
document.write("<br/>");
document.write(arr[0] + arr[3][0] + arr[3][3][1]);//输出148
document.write("<br/>");
document.write(arr[1] + arr[3][1] + arr[3][3][0]);//输出257
*/
var navs1 = ["主页","关于我们","产品","服务","联系我们"];
document.write('<ul class="nav">');
for(var i in navs1){
document.write('<li><a href="#">'+navs1[i]+'</a></li>');
}
document.write('</ul>');
</script>
<ul class="nav">
<li><a href="#">主页</a></li>
<li><a href="#">关于我们</a></li>
<li><a href="#">产品</a></li>
<li><a href="#">服务</a></li>
<li><a href="#">联系我们</a></li>
</ul>
</body>
</html>