28,390
社区成员
发帖
与我相关
我的任务
分享
<!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">
<head>
<html:base/>
<meta http-equiv="content-type" content="text/html;charset=gb2312"/>
<title>首页</title>
<script type="text/javascript" src="mootools.js"></script>
<style type="text/css">
<!--
* {margin:0;padding:0}
a.chick:link,a.chick:visited {
display:block;
overflow:hidden;
width:79px;
height:25px;
color:#fff;
text-decoration:none;
background:black;
}
a.chick:hover,a.chick:active {
background:#ccc;
}
a.chicked:link,a.chicked:visited {
display:block;
overflow:hidden;
width:79px;
height:25px;
color:#000;
background:#ccc;
text-decoration:none;
}
a.chicked:hover,a.chicked:active {
background:#ccc;
}
.mainnav{
float:left;
width:800px;
border-right:#e3e3e3 1px;
border-left:#e3e3e3 1px;
overflow:hidden;
cursor:pointer;
}
.mainnav li {
float:left;
overflow:hidden;
width:79px;
height:25px;
line-height:30px;
color:#353535;
text-align:center;
}
.nav {clear:both}
.nav li {list-style:none;display:inline;margin:10px;height:25px;line-height:25px;}
-->
</style>
</HEAD>
<BODY>
<!---- ==================================== 页面中唯一不一样的地方 start ======================================= ------->
<span id="indexpage"></span><!-- 判断top导航 -->
<!---- ==================================== 页面中唯一不一样的地方 end ======================================= ------->
<!-- 这是头部包含内容-->
<ul class="mainnav">
<li><a id="topindex" href="index.html" class="chick">首页</a></li>
<li><a id="topdate" href="news.html" class="chick">新闻</a></li>
<li><a href="#" id="blogSrc" class="chick">产品</a></li>
<li class="nonavclear"><a href="#" id="albumSrc" class="chick">其他</a></li>
</ul>
<ul id="indexnav" class="nav" style="display:none">
<li>首页</li><li>首页</li><li>首页</li><li>首页</li><li>首页</li>
</ul>
<ul id="datenav" class="nav" style="display:none">
<li>新闻</li><li>新闻</li><li>新闻</li><li>新闻</li><li>新闻</li>
</ul>
<ul id="blognav" class="nav" style="display:none">
<li>产品</li><li>产品</li><li>产品</li><li>产品</li><li>产品</li>
</ul>
<ul id="photonav" class="nav" style="display:none">
<li>其他</li><li>其他</li><li>其他</li><li>其他</li><li>其他</li>
</ul>
<script text="type/javascript">
var arrayFlag = new Array("datepage","blogpage","photopage","indexpage"); //这是页面中调用的id标示
var arrayNav = new Array("datenav","blognav","photonav","indexnav"); //这是下拉菜单
var arraySrc = new Array("topdate","blogSrc","albumSrc","topindex"); //这是导航id
arrayFlag.each(function(item,index){
if($(item)){
$(arraySrc[index]).setAttribute('className','chicked');
}
});
arrayFlag.each(function(item,index){
if($(item)){
$(arrayNav[index]).style.display="block";
}
});
</script>
<!-- 这是头部包含内容-->
</BODY>
</HTML>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
.indentmenu{
font: bold 13px Arial;
width: 100%; /*leave this value as is in most cases*/
}
.indentmenu ul{
margin: 0;
padding: 0;
float: left;
width: 80%; /*width of menu*/
border: 1px solid #564c66; /*dark purple border*/
border-width: 1px 0;
background: black;
}
.indentmenu ul li{
display: inline;
}
.indentmenu ul li a{
float: left;
color: white; /*text color*/
padding: 5px 11px;
text-decoration: none;
border-right: 1px solid #564c66; /*dark purple divider between menu items*/
}
.indentmenu ul li a:visited{
color: white;
}
#home .indentmenu li.home a,#css .indentmenu li.css a,#forums .indentmenu li.forums a,#tools .indentmenu li.tools a,#javascript .indentmenu li.javascript a,#gallery .indentmenu li.gallery a {
color: white !important; /*text color of selected and active item*/
padding-top: 6px; /*shift text down 1px for selected and active item*/
padding-bottom: 4px; /*shift text down 1px for selected and active item*/
background: #ccc;
}
</style>
</head>
<body id="home">
<!-- 这是头部包含内容-->
<div class="indentmenu">
<ul>
<li class="home"><a href="home.html">Home</a></li>
<li class="css"><a href="css.html">CSS</a></li>
<li class="forums"><a href="forums.html">Forums</a></li>
<li class="tools"><a href="tools.html">Webmaster Tools</a></li>
<li class="javascript"><a href="javascript.html">JavaScript</a></li>
<li class="gallery"><a href="gallery.html">Gallery</a></li>
</ul>
<br style="clear: left" />
</div>
<!-- 这是头部包含内容-->
</body>
</html>