主题:  XP效果的导航菜单(NEW)

xiaoyun_5d

职务:普通成员
等级:1
金币:0.0
发贴:6
注册:2002/10/13 8:56:07
#12002/10/13 9:18:49
--------------------------------------------


-----------------------------------------------------
------------------------------------------------------

/*--------------------------------------------
管理样式多级菜单 1.0 制作 Stroll

--------------------------------------------*/

//--------------- 有关数据 -----------------//

var IconList = new Array(); // icon图片 集合, 下标从 1 开始

    IconList[1] = new Image();
    
    IconList[1].src = "icon/edit.gif";
    

//---------------- 检测变量 菜单的显示隐藏就靠它了!!! ------------------//    


var SubMenuList = new Array();

var NowSubMenu = "";    

var mouseCanSound = true;     //--------------------------- 声音开关 ------ 声音开关 ------------------//

var menuSpeed = 50; //---------- 菜单显示速度 ------------//

var alphaStep = 30; //---------- Alpaha 变化 度 -----------//


//------------- 构建 顶部菜单 对象 -------------//

function TopMenu(objName,L,T)
{
    this.id      = "Menu_"+objName;
    this.obj      = objName;
    this.length = 0;
    
    this.L = L
    
    this.T = T
    
    this.addTopMenu = addTopMenu;
    this.addTopLink = addTopLink;
    
    this.returnAll = returnAll
    
    document.body.insertAdjacentHTML('afterBegin','');
}

//----------returnAll----------------//

function returnAll(str)
{
    var obj = eval("temp_"+this.id);
    
    str = eval(str)
    
    var tempstr = obj.innerHTML

    
    obj.outerHTML = "";
    
    str.insertAdjacentHTML('beforeEnd',tempstr)
    

    
}

//----------- 构建 子菜单 对象 -------------//

function SubMenu(objName,objID)
{
    this.obj = objName;
    this.id = objID;

    this.addMenu = addMenu;
    this.addLink = addLink;
    this.addHR = addHR;

    this.length = 0;
}


//-------------- 主菜单对象 addTopMenu 方法 ------------//
function addTopMenu(word,icon,title)
{
    var subID = this.id + "_" + this.length;
    var subObj = this.obj+"["+this.length+"]";
    
    var oldID = this.id;
    
    eval(subObj+"= new SubMenu('"+subObj+"','"+subID+"')");
    
     makeTopMenu(subID,oldID,word,icon,title);
    
     this.length++;
    
}


//------------- 主菜单对象 addTopLink 方法 -------------//
function addTopLink(word,icon,url,target,title)
{
    var subID = this.id + "_" + this.length;
    var oldID = this.id;
    
     makeTopLink(subID,oldID,word,icon,url,target,title);
    
     this.length++;    
}

//-------------- 生成 菜单 makeTopMenu 方法 -----------//
function makeTopMenu(subID,oldID,word,icon,thetitle)
{
    if(icon&&icon!="")
    {
        icon = '';
    }
    else
    {
        icon = '';
    }
    
    if(!thetitle||thetitle=="")
    {
        thetitle = '';
    }
    
    
    var Oobj = document.getElementById(oldID);

    /*--------------------------------------------- 菜单html样式