手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网页制作>Javascript>列表

类似于Outlook的导航菜单

来源:互联网 作者:west263.com 时间:2008-02-23
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

  看到一个类似于Outlook的导般菜单,功能挺不错的,而且制作方法也较简单,特简单介绍一下,先请参看效果!

  点击这里预览效果页面

  制作方法:

  1、在<body>插入代码:

<SCRIPT>
function showitem(id,name)
{
return ("<span><a href='" id "' target=_self>" name "</a></span><br>")
}
function switchoutlookBar(number)
{
var i = outlookbar.opentitle;
outlookbar.opentitle=number;
var id1,id2,id1b,id2b
if (number!=i && outlooksmoothstat==0){
if (number!=-1)
{
if (i==-1)
{
id2="blankdiv";
id2b="blankdiv";}
else{
id2="outlookdiv" i;
id2b="outlookdivin" i;
document.all("outlooktitle" i).style.border="1px none navy";
document.all("outlooktitle" i).style.background="#006CD9";
document.all("outlooktitle" i).style.color="#ffffff";
document.all("outlooktitle" i).style.textalign="center";
}
id1="outlookdiv" number
id1b="outlookdivin" number
document.all("outlooktitle" number).style.border="1px none white";
document.all("outlooktitle" number).style.background="#006CD9"; //title
document.all("outlooktitle" number).style.color="#ffffff";
document.all("outlooktitle" number).style.textalign="center";
smoothout(id1,id2,id1b,id2b,0);
}
else
{
document.all("blankdiv").style.display="";
document.all("blankdiv").sryle.height="100%";
document.all("outlookdiv" i).style.display="none";
document.all("outlookdiv" i).style.height="0%";
document.all("outlooktitle" i).style.border="1px none navy";
document.all("outlooktitle" i).style.background="#006CD9";
document.all("outlooktitle" i).style.color="#ffffff";
document.all("outlooktitle" i).style.textalign="center";
}
}
}
function smoothout(id1,id2,id1b,id2b,stat)
{
if(stat==0){
tempinnertext1=document.all(id1b).innerHTML;
tempinnertext2=document.all(id2b).innerHTML;
document.all(id1b).innerHTML="";
document.all(id2b).innerHTML="";
outlooksmoothstat=1;
document.all(id1b).style.overflow="hidden";
document.all(id2b).style.overflow="hidden";
document.all(id1).style.height="0%";
document.all(id1).style.display="";
setTimeout("smoothout('" id1 "','" id2 "','" id1b "','" id2b "'," outlookbar.inc ")",outlookbar.timedalay);
}
else
{
stat =outlookbar.inc;
if (stat>100)
stat=100;
document.all(id1).style.height=stat "%";
document.all(id2).style.height=(100-stat) "%";
if (stat<100)
setTimeout("smoothout('" id1 "','" id2 "','" id1b "','" id2b "'," stat ")",outlookbar.timedalay);
else
{
document.all(id1b).innerHTML=tempinnertext1;
document.all(id2b).innerHTML=tempinnertext2;
outlooksmoothstat=0;
document.all(id1b).style.overflow="auto";
document.all(id2).style.display="none";
}
}
}
function getOutLine()
{
outline="<table " outlookbar.otherclass ">";
for (i=0;i<(outlookbar.titlelist.length);i )
{
outline ="<tr><td name=outlooktitle" i " id=outlooktitle" i " ";
if (i!=outlookbar.opentitle)
outline =" nowrap align=center style='cursor:hand;background-color:#006CD9;color:#ffffff;height:5;border:1 none navy' ";
else
outline =" nowrap align=center style='cursor:hand;background-color:#006CD9;color:white;height:5;border:1 none white' ";
outline =outlookbar.titlelist[i].otherclass
outline =" onclick='switchoutlookBar(" i ")'>";
outline =outlookbar.titlelist[i].title "</td></tr>";
outline ="<tr><td name=outlookdiv" i " valign=top align=center id=outlookdiv" i " style='width:100%"
if (i!=outlookbar.opentitle)
outline =";display:none;height:0%;";
else
outline =";display:;height:100%;";
outline ="'><div name=outlookdivin" i " id=outlookdivin" i " style='overflow:auto;width:100%;height:100%'>";
for (j=0;j<outlookbar.itemlist[i].length;j )
outline =showitem(outlookbar.itemlist[i][j].key,outlookbar.itemlist[i][j].title);
outline ="</div></td></tr>"
}
outline ="</table>"
return outline
}
function show()
{
var outline;
outline="<div id=outLookBarDiv name=outLookBarDiv style='width=100%;height:100%'>"
outline =outlookbar.getOutLine();
outline ="</div>"
document.write(outline);
}
function theitem(intitle,instate,inkey)
{
this.state=instate;
this.otherclass=" nowrap ";
this.key=inkey;
this.title=intitle;
}
function addtitle(intitle)
{
outlookbar.itemlist[outlookbar.titlelist.length]=new Array();
outlookbar.titlelist[outlookbar.titlelist.length]=new theitem(intitle,1,0);
return(outlookbar.titlelist.length-1);
}
function additem(intitle,parentid,inkey)
{
if (parentid>=0 && parentid<=outlookbar.titlelist.length)
{
outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length]=new theitem(intitle,2,inkey);
outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length-1].otherclass=" nowrap align=left style='height:5' ";

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!