SoFunction
Updated on 2025-04-13

js class background management menu class - MenuSwitch


    function MenuSwitch(className){        
        this._elements = [];
        this._default = -1;
        this._className = className;
        this._previous = false;
    }
     = function(id){
        this._default = Number(id);
    }
     = function(flag){
        this._previous = Boolean(flag);
    }
     = function(){
        this._elements = [];
        var allelements = ("div");
        for(var i=0;i<;i++){
            var mItem = allelements[i];
            if (typeof  == "string" &&  == this._className){
                var h3s = ("h3");
                var uls = ("ul");
                if( == 1 &&  == 1){
                    h3s[0]. = "hand";                    
                    if(this._default == this._elements.length){
                        uls[0]. = "block";    
                    }else{
                        uls[0]. = "none";    
                    }
                    this._elements[this._elements.length] = mItem;
                }                
            }
        }
    }
     = function(mElement){
        var uls = ("ul");
        uls[0]. = "block";
    }
     = function(mElement){
        var uls = ("ul");
        uls[0]. = "none";
    }
     = function(mElement){
        var uls = ("ul");        
        return uls[0]. == "block";
    }
     = function(header){
        var mItem;
        if(){
            mItem = ;
        }else{
            mItem = ;
        }
        if((mItem)){
            (mItem);
        }else{
            (mItem);
        }        
        if(!this._previous){
            for(var i=0;i<this._elements.length;i++){
                if(this._elements[i] != mItem){                
                    var uls = this._elements[i].getElementsByTagName("ul");
                    uls[0]. = "none";        
                }
            }
        }
    }    
     = function(){        
        var instance = this;
        ();
        if(this._elements.length==0){
            return;
        }
        for(var i=0;i<this._elements.length;i++){
            var h3s = this._elements[i].getElementsByTagName("h3");            
            if(){
                h3s[0].addEventListener("click",function(){(this);},false);
            }else{
                h3s[0].onclick = function(){(this);}
            }
        }
    }