日期:2014-05-20  浏览次数:20823 次

下拉菜单js求助
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="comm.master.cs" Inherits="client_comm" %>

<!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=gb2312" />
<title>浙江赛孚信息咨询有限公司</title>

<script type="text/javascript">
  var currentItem=''; //选中左侧菜单项
var subNavi=''; //当前选中导航项子项
var currentNavi =''; //当前选中导航项

  var currentNaviIndex=1;
  function setBg(index){
  document.getElementById("navTable").style.backgroundImage='url(../img/'+index+')';
  }
   
  function cancelBg(index){
  if(index!=currentNavIndex)
  {
   
  }
  }
   
   
  function menuClick(obj,subObj)
{
 
if($(subObj).style.display=="none")
{
$(subObj).style.display="block";
menuSelected(obj)
}
else
{
$(subObj).style.display="none";
$(obj).className="menuItem";
}
}

function menuSelected(obj)
{
if(currentItem!=''&&currentItem!=obj)
{
$(currentItem).className="menuItem";
}
$(obj).className="menuItemOver";
currentItem=obj;
}
function $(obj)
{
return document.getElementById(obj);
}

function naviSelected(obj)
{
if(currentNavi!=''&&currentNavi!=obj)
{
$(currentNavi).className="naviItem";
}
$(obj).className="naviItemOver";
currentNavi=obj;
}

function naviOver(obj,showSub)
  {
  if(showSub==1)
  {
  $(obj).style.display="block";
  }
  if(subNavi!=''&&subNavi!=obj)
  {
  $(subNavi).style.display="none"; 
  }
   
  if(showSub==1)
  {
  subNavi=obj;
  }
   
  }
  function naviOut(obj)
  {
  $(obj).style.display="none";
  subNavi="";
  }

</script>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #CFF2D2;
background-image: url(../img/sf_r1_c3.jpg);
}
#subNaviTable td
{
  color:#000000;
}
#subNaviTable td a
{
  color:#000000;
}
#subNaviTable .subNavi
{
  display:none;
}
-->
</style></head>

<body>
<form runat="server" id="form1">
<table width="941" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
  <td height="110" align="left" valign="top" background="../img/s_r1_c1.jpg">
   
  <table width="941" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
  <td width="370" height="68" align="center"><img src="../img/s_r1_c3.jpg" width="370" height="68" /></td>