当前位置: 代码迷 >> HTML/CSS >> 动态下拉菜单如何样才能默认打开
  详细解决方案

动态下拉菜单如何样才能默认打开

热度:289   发布时间:2012-02-24 16:30:38.0
动态下拉菜单怎么样才能默认打开
下拉菜单的代码是:
scores   =   new   Array(20);
var   numTotal=0;
NS4   =   (document.layers)   ?   1   :   0;
IE4   =   (document.all)   ?   1   :   0;
ver4   =   (NS4   ||   IE4)   ?   1   :   0;


function   getIndex(el)   {
        ind   =   null;
        for   (i=0;   i <document.layers.length;   i++)   {
                whichEl   =   document.layers[i];
                if   (whichEl.id   ==   el)   {
                        ind   =   i;
                        break;
                }
        }
        return   ind;
}

function   arrange()   {
        nextY   =   document.layers[firstInd].pageY   +document.layers[firstInd].document.height;
        for   (i=firstInd+1;   i <document.layers.length;   i++)   {
                whichEl   =   document.layers[i];
                if   (whichEl.visibility   !=   "hide ")   {
                        whichEl.pageY   =   nextY;
                        nextY   +=   whichEl.document.height;
                }
        }
}

function   initIt(){
        if   (!ver4)   return;
        if   (NS4)   {
                for   (   i=0;   i <document.layers.length;   i++)   {
                        whichEl   =   document.layers[i];
                        if   (whichEl.id.indexOf( "Child ")   !=   -1)   whichEl.visibility   =   "hide ";
              }
                arrange();
        }
        else   {
                divColl   =   document.all.tags( "DIV ");
                for   (   i=0;   i <divColl.length;   i++)   {
                        whichEl   =   divColl(i);
                        if   (whichEl.className   ==   "child ")   whichEl.style.display   =   "none ";
                }
        }
}

function   expandIt(el)   {
if   (!ver4)   return;
        if   (IE4)   {