最近做了个网站,在自己电脑菜单显示正常,但是IIS发布后,别人电脑登录网站,子菜单点开会跟父菜单叠在一起,不知道哪里出问题了。如下代码:
    this.showMenu = function(x,y,w){     
         
        var h = 0;       
        if ( this.popup != null && this.popup != "null" ){
            if ( !this.popup.isOpen ){
                try{
                    this.currentMenuItem.showNormal() 
                }catch(e){};
                w =  menuPosition[0];
                h =  menuPosition[1];
                this.popup.show(x, y, w, h,document.body); 
            }
            return;
        }
        var d = this.getMeasureDiv(); 
        var t0 = new Date().getTime();     
        h = d.firstChild.offsetHeight;
        //window.status += "菜单耗时:"+(new Date().getTime() - t0);
        w = d.firstChild.offsetWidth;
        
        this.getPopup();   
        var oPopupBody =  this.popup.document.body;
        this.popup.document.createStyleSheet(MenuBar.cssSrc);    
        
        if  ( this.parentMenu !=null && this.parentMenu.getEl().className == "MenuRootActive" )
            oPopupHtml =   d.innerHTML +"<DIV class=\"MenuRootModify\" style=\" WIDTH: "+ (this.parentMenu.getEl().offsetWidth-2) +"; \"></DIV>";
        else
            oPopupHtml =  d.innerHTML;
        d.innerHTML = "";
        oPopupBody.innerHTML = oPopupHtml;
        oPopupBody.firstChild.style.visibility = "visible"; 
        this._document = this.popup.document;
//        try{
//        this._showTimer = window.setTimeout(
//                new Function("eventListeners.onshowtimer(\"" + this.id + "\",\""+x+"\",\""+y+"\",\""+w+"\",\""+h+"\")" ),
//                window.menuBar1.showTimeout );  
//        }
//        catch(e){
          this.popup.show(x, y, w, h,document.body);
//        }
          
        menuPosition[0]=w;
        menuPosition[1]=h;
        this.menuState = true ;  
          
        this.AddEvent();   
       
    }
    this.showSubMenu = function(){
        //        var x = getTrElement(this.parentMenu.getWindow().event.srcElement).offsetWidth-1;
        var x = getTrElement(this.parentMenu.getWindow().event.srcElement).offsetLeft + getTrElement(this.parentMenu.getWindow().event.srcElement).offsetWidth-1
        var y = getTrElement(this.parentMenu.getWindow().event.srcElement).offsetTop-2;
        var w ;
        this.parentMenu.currentSubMenu = this ;
        if (this.parentMenu.currentSubMenu != null) {        
        this.parentMenu.subMenuState = true ;
    }
    this.showMenu(x, y, w);
    }
    this.AddEvent = function(){
        var tb = this.element = this._document.getElementById(this.id);    
        with (this._document){
            attachEvent("onmouseover",new Function ("eventListeners.Menu.onmouseover('"+this.id+"')"));
            attachEvent("onmouseout",new Function ("eventListeners.Menu.onmouseout('"+this.id+"')"));
            attachEvent("onclick",new Function ("eventListeners.Menu.onclick('"+this.id+"')"));           
            attachEvent("oncontextmenu",new Function ("eventListeners.oncontextmenu('"+this.id+"')"));
            attachEvent("onselectstart",new Function ("eventListeners.onselectstart('"+this.id+"')"));
            
        }
        window.attachEvent("onunload",new Function ("eventListeners.Menu.onunload('"+this.id+"')"));
    }