JS问题很急,请各位看下。
http://www.跟这个一样只是我只有第3个是有子菜单上面两个没有子菜单只是图片背景会变换,就是我想做到在刷新的情况下,我选择的一级导航不会跳回去。比如:我选择了第二个一级导航“查询项目”; 我刷新页面后还是在“查询项目”,不会跳到“项目汇总”;总导航点击背景色会变得那种。
在线等了,高手急救!!!急急急。。。。由于后台不会做局部刷新。
程序代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. xmlns="http://www. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function showleftmenu(num){
if(document.getElementById("help_center_leftmenu"+num).className=="active"){
for(var i=0;i<3;i++){
document.getElementById("help_center_leftmenu"+i).className="";
document.getElementById("menu_content"+i).style.display="none";
}
}else{
for(var i=0;i<3;i++){
document.getElementById("help_center_leftmenu"+i).className="";
document.getElementById("menu_content"+i).style.display="none";
}
document.getElementById("help_center_leftmenu"+num).className="active";
document.getElementById("menu_content"+num).style.display="block";
}
}
function showmenuitem(thisid){
var items=document.getElementById("help_categories").getElementsByTagName("a");
for(var i=0;i<items.length;i++){
if(items[i].className=="style"){
items[i].className="";
}
}
thisid.className="style";
}
</script>
<style type="text/css">
#help_categories {
width:157px;
height:468px;
background:#eff0f2;
margin:4px 0 0 4px;
}
.classification {
width:157px;
float:left;
height:auto;
}
.set_up {
width:157px;
float:left;
height:auto;
}
.set_up h3 {
text-align:center;
background:#330000;
height:auto;
line-height:30px;
font-size:12px;
font-weight:bold;
cursor:pointer;
}
.set_up h3.active {
background:#006600;
height:auto;
line-height:47px;
color:#FFF;
}
.set_up h3 a, .set_up a {
color:#000000;
display:block;
}
.set_up ul li {
width:150px;
float:right;
line-height:25px;
}
</style>
</head>
<body>
<div id="help_categories">
<div class="classification">
<div class="set_up">
<h3 id="help_center_leftmenu1"><a href="#" onmousedown="showleftmenu(1)" target="_blank">项目浏览</a></h3>
<ul id="menu_content1" style="display:none;">
</ul>
</div>
<div class="set_up" style="margin-top:3px;">
<h3 id="help_center_leftmenu2"><a href="#" onmousedown="showleftmenu(2)" target="_blank">查询项目</a></h3>
<ul id="menu_content2" style="display:none;">
</ul>
</div>
<div class="set_up" style="margin-top:3px;">
<h3 id="help_center_leftmenu0" class="active"><a href="#" onmousedown="showleftmenu(0)">项目汇总</a></h3>
<ul id="menu_content0">
<li><a onclick="showmenuitem(this)" style=" cursor:pointer" >·标志设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·VI设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·包装设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·网站设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·空间设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·导示设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·工业设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·品牌顾问</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·品牌命名</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·广告设计</a></li>
<li><a onclick="showmenuitem(this)" style=" cursor:pointer">·传媒设计</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
[ 本帖最后由 liweilkm 于 2010-8-11 16:11 编辑 ]








