You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
172 lines
4.2 KiB
172 lines
4.2 KiB
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LeftUc.ascx.cs" Inherits="UC_LeftUc" %>
|
|
<div class="LeftBar" id="LeftBar">
|
|
<asp:Literal ID="ltLeftMenu" runat="server"></asp:Literal>
|
|
</div>
|
|
|
|
<script language="JavaScript1.2">
|
|
<!--
|
|
var clkedId = "";
|
|
var chgedId = "";
|
|
var openId = "";
|
|
var openIndex = "";
|
|
//获取本菜单中的第一级菜单控件
|
|
function getLeftBarItem(itemid)
|
|
{
|
|
var item;
|
|
var leftBar = document.getElementById("LeftBar");
|
|
for(i=0;i<leftBar.childNodes.length;i++)
|
|
{
|
|
if(leftBar.childNodes[i].id == itemid)
|
|
{
|
|
item = leftBar.childNodes[i];
|
|
break;
|
|
}
|
|
}
|
|
return item;
|
|
}
|
|
|
|
function change()
|
|
{
|
|
var curEleId = event.srcElement.id;
|
|
var clickObj = getLeftBarItem(event.srcElement.id);
|
|
if (clickObj != null && (clickObj.className=="Header" || clickObj.className=="HeaderOver"
|
|
|| clickObj.className=="HeaderExpand" || clickObj.className=="HeaderCoop"))
|
|
{
|
|
var srcIndex = event.srcElement.sourceIndex;
|
|
var nested = document.all[srcIndex+2];
|
|
if (nested.style.display=="none")
|
|
{
|
|
if (openId!="")
|
|
{
|
|
openId.style.display = "none";
|
|
imgId = document.all[openIndex+1];
|
|
if( imgId != null)
|
|
imgId.className="HeaderExpand";
|
|
}
|
|
nested.style.display='';
|
|
openId = nested;
|
|
openIndex = srcIndex;
|
|
var nested = document.all[srcIndex+1];
|
|
if( nested != null)
|
|
nested.className="HeaderCoop";
|
|
}
|
|
else
|
|
{
|
|
nested.style.display="none";
|
|
openId = "";
|
|
openIndex = "";
|
|
var nested = document.all[srcIndex+1];
|
|
if( nested != null)
|
|
nested.className="HeaderExpand";
|
|
}
|
|
return;
|
|
}
|
|
|
|
if (curEleId == "submenu")
|
|
{
|
|
var srcIndex = event.srcElement.sourceIndex
|
|
var i=1;
|
|
var nested;
|
|
while(i<document.all.length)
|
|
{
|
|
nested = document.all[srcIndex-i];
|
|
if (nested.className == "Header" || nested.className == "HeaderOver")
|
|
break;
|
|
else
|
|
i++;
|
|
}
|
|
startPos = nested.innerHTML.indexOf(">") + 7;
|
|
endPos = nested.innerHTML.length;
|
|
clkedId.className = "";
|
|
clkedId = document.all[srcIndex];
|
|
clkedId.className = "clkBg";
|
|
clkedId.blur();
|
|
document.location =clkedId.href
|
|
return;
|
|
}
|
|
if (event.srcElement.className=="Title")
|
|
{
|
|
if (openId!="")
|
|
{
|
|
openId.style.display = "none";
|
|
openId = "";
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
function changeBG()
|
|
{
|
|
if (chgedId!="")
|
|
{
|
|
var oldchge = getLeftBarItem(chgedId);
|
|
if( oldchge.className =="HeaderOver")
|
|
oldchge.className="Header";
|
|
chgedId = ""
|
|
}
|
|
if( event.srcElement.id != null && event.srcElement.id != "")
|
|
{
|
|
var chobj = getLeftBarItem(event.srcElement.id);
|
|
if(chobj != null && chobj.className=="Header")
|
|
{
|
|
chobj.className = "HeaderOver";
|
|
chgedId = event.srcElement.id;
|
|
}
|
|
}
|
|
}
|
|
function hiddenFolderlist()
|
|
{
|
|
var nested;
|
|
var leftBar = document.getElementById("LeftBar");
|
|
for(i=0;i<leftBar.childNodes.length;i++)
|
|
{
|
|
nested = leftBar.childNodes[i];
|
|
if (nested.className == "List")
|
|
nested.style.display="none";
|
|
}
|
|
}
|
|
function expandmenu()
|
|
{
|
|
var bclik = false;
|
|
var nested;
|
|
var leftBar = document.getElementById("LeftBar");
|
|
for(i=0;i<leftBar.childNodes.length;i++)
|
|
{
|
|
nested = leftBar.childNodes[i];
|
|
var ulIndex = document.all[nested.sourceIndex+2];
|
|
if( ulIndex != null && ulIndex.className=="List")
|
|
{
|
|
for(j=0;j<ulIndex.childNodes.length;j++)
|
|
{
|
|
var lia = ulIndex.childNodes[j].childNodes[0];
|
|
if( lia.href == document.location)
|
|
{
|
|
ulIndex.style.display="";
|
|
openId = ulIndex;
|
|
openIndex = nested.sourceIndex;
|
|
if( nested.childNodes.length>0)
|
|
{
|
|
var img = nested.childNodes[0];
|
|
if( img.className=="HeaderExpand" || img.className=="HeaderCoop")
|
|
{
|
|
img.className="HeaderCoop";
|
|
}
|
|
}
|
|
clkedId = lia;
|
|
clkedId.className = "clkBg";
|
|
bclik = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
if( bclik == true)
|
|
break;
|
|
}
|
|
}
|
|
document.getElementById("LeftBar").onclick=change;
|
|
document.getElementById("LeftBar").onmouseover = changeBG;
|
|
hiddenFolderlist();
|
|
expandmenu();
|
|
//-->
|
|
</script>
|
|
|
|
|