藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 應用編程


    

藍森林 http://www.lslnet.com 2006年8月25日 8:28

請各位老大幫我一下吧

我現在急需這種效果,但自己一時之間也學不會
http://www.hxsd.com.cn/web/zyxx/zyxx_menu.htm
請各位大哥提供下源碼下載行嗎?
在下感激不盡~~~~~~~~~~

把這個網頁保存下來直接改文字和鏈接就行了

好像不行喔 ,
那是用JS做的,保存不了啊
保存了會出錯~~~~~
教我下行嗎

頁面文件:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>下拉菜單</title>
<base target="_blank">
<STYLE type=text/css>
.np {
        FONT-SIZE: 16px; CURSOR: hand; COLOR: black; FONT-FAMILY: Webdings
}
A:link {
        FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
        FONT-SIZE: 12px; COLOR: #000000; TEXT-DECORATION: none
}
A:hover {
        FONT-SIZE: 12px; COLOR: #cc0000; TEXT-DECORATION: none
}
BODY {
        SCROLLBAR-FACE-COLOR: #E8F0F8; FONT-SIZE: 12px; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #000000; SCROLLBAR-3DLIGHT-COLOR: #E8F0F8; SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #E8F0F8; SCROLLBAR-DARKSHADOW-COLOR: #E8F0F8
}
TD {
        FONT-SIZE: 12px; LINE-HEIGHT: 150%
}
</STYLE>
<SCRIPT language=javascript>
function switchSysBar(){
        if (switchPoint.innerText==3){
                switchPoint.innerText=4
                document.all("mnuList").style.display="none"
                top.content.cols="16,*"
        }
        else{
                switchPoint.innerText=3
                document.all("mnuList").style.display=""                               
                top.content.cols="166,*"               
        }
}
       


</SCRIPT>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<SCRIPT>
function showitem(id,name)
{
return ("<span><a href='"+id+"' target=blank>"+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="#234290";
                                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="#234290"; //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="#234290";
                        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:#234290;color:#ffffff;height:5;border:1 none navy' ";
                        else
                                outline+=" nowrap align=center style='cursor:hand;background-color:#234290;color:white;height:5;border:1 none white' ";
                        outline+=outlookbar.titlelist[i].otherclass
                        outline+=" onclick='switchoutlookBar("+i+")'><span class=smallFont>";
                        outline+=outlookbar.titlelist[i].title+"</span></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' ";
                return(outlookbar.itemlist[parentid].length-1);
        }
        else
                additem=-1;
}

function outlook()
{
        this.titlelist=new Array();
        this.itemlist=new Array();
        this.divstyle="style='height:100%;width:100%;overflow:auto' align=center";
        this.otherclass="border=0 cellspacing='0' cellpadding='0' style='height:100%;width:100%'valign=middle align=center ";
        this.addtitle=addtitle;
        this.additem=additem;
        this.starttitle=-1;
        this.show=show;
        this.getOutLine=getOutLine;
        this.opentitle=this.starttitle;
        this.reflesh=outreflesh;
        this.timedelay=50;
        this.inc=10;
       
}

function outreflesh()
{
        document.all("outLookBarDiv").innerHTML=outlookbar.getOutLine();
}

function locatefold(foldname)
{
        for (var i=0;i<outlookbar.titlelist.length;i++)
                if(foldname==outlookbar.titlelist[i].title)
                        {
                                 outlookbar.starttitle=i;
                                 outlookbar.opentitle=i;
                        }
       
}

var outlookbar=new outlook();
var tempinnertext1,tempinnertext2,outlooksmoothstat
outlooksmoothstat = 0;

</SCRIPT>
<SCRIPT language="">
        document.write("<script src=2_nav.js></"+"script>");
//        outlookbar.otherclass="bgcolor=#cccccc border=0 cellspacing=0 cellpadding=0 style='height:100%;width:100%;' valign=middle align=center ";   
</SCRIPT>

<TABLE height="50%" cellSpacing=0 cellPadding=0 width=159 align=center
border=0>
  <TBODY>
    <TR>
      <TD vAlign=top>
        <TABLE id=mnuList style="WIDTH: 140px; HEIGHT: 100%" cellSpacing=0
      cellPadding=0 align=center border=0>
          <TBODY>
            <TR>
              <TD id=outLookBarShow vAlign=top align=middle name="outLookBarShow"><img src="images/spacer.gif" width="1" height="1"></TD>
            </TR>
            <TR>
              <TD id=outLookBarShow style="HEIGHT: 100%" vAlign=top align=middle
          bgColor=#CCCC00 name="outLookBarShow">
                  <SCRIPT language="">
           locatefold("菜單1")
            outlookbar.show()       
      </SCRIPT> </TD>
            </TR>
          </TBODY>
        </TABLE></TD>
      <TD width=16 bgColor=#D7EFFF>             
            <table cellspacing=0 cellpadding=0 border=0>
        <tbody>
          <tr>
            <td valign=center align=middle>
                        <span class=np id=switchPoint  title=打開/關閉導航  onClick=switchSysBar()>3</span></td>
          </tr>
        </tbody>
      </table></TD>
    </TR>
  </TBODY>
</TABLE>
</body>
</html>



js文件:

var t;
t=outlookbar.addtitle('菜單1')
outlookbar.additem(' 菜單1-1',t,'http://www.sdthunis.com')
outlookbar.additem(' 菜單1-2',t,'http://www.sdthunis.com')

t=outlookbar.addtitle('菜單2')
outlookbar.additem(' 菜單2-1',t,'http://www.sdthunis.com')
outlookbar.additem(' 菜單2-2',t,'http://www.sdthunis.com')

t=outlookbar.addtitle('菜單3')
outlookbar.additem(' 菜單3-1',t,'http://www.sdthunis.com')
outlookbar.additem(' 菜單3-2',t,'http://www.sdthunis.com')

將這個js文件保存為2_nav.js,放在同一個目錄下面

看看怎麼樣

多謝老大指點
~~~




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com