Ajax Layer JavaScript DHTML


    
        
        DynAPI Examples - PanelBar & Stacker
        
        
            dynapi.library.setPath('./dynapisrc/');
            dynapi.library.include('dynapi.library');
            dynapi.library.include('dynapi.api');
            dynapi.library.include('dynapi.gui.PanelBar');
            dynapi.library.include('dynapi.gui.Stacker');
            dynapi.library.include('dynapi.functions.Image');
            dynapi.library.include('DragEvent');
        
        
        
            f=dynapi.functions;
            var imgmin=f.getImage('./dynapiexamples/images/win_min.gif',15,16);
            var imgmax=f.getImage('./dynapiexamples/images/win_max.gif',15,16);
            
            var lyrMenu = new DynLayer();
            lyrMenu.setClass ('cssmenu');
            lyrMenu.setHTML('My Menu #1{@min}')
            var lyrContent = new DynLayer('This PanelBar and the two under are in the stacker, the stacker reacts on sizechanges and moves the layers when the size changes.');
            lyrContent.setClass ('csscontent');
            var lyrPanelBar = new PanelBar(lyrMenu,lyrContent,20,50,50,200,100,false);
            lyrPanelBar.setMinMaxImg(imgmin,imgmax);
            
            var lyrMenu1 = new DynLayer();
            lyrMenu.setClass ('cssmenu');
            lyrMenu1.setClass ('cssmenu');
            lyrMenu1.setHTML('My Menu #2{@min}')
            var lyrContent1 = new DynLayer('This PanelBar has been created using a layer for the menu and one for the content.');
            lyrContent1.setClass ('csscontent');
            var lyrPanelBar1 = new PanelBar(lyrMenu1,lyrContent1,20,250,50,200,100,true);
            lyrPanelBar1.setMinMaxImg(imgmin,imgmax);
            
            // Create a PanelBar with HTML instead of layers
            var lyrPanelBar2 = new PanelBar(
                'My Menu #3{@min}',
                'This PanelBar has been created using simply html-text instead of two layers.',
                20,250,50,200,100,false);
            lyrPanelBar2.setMinMaxImg(imgmin,imgmax);
            
            // Manipulate the menu- and contentlayer
            lyrPanelBar2.getContentLayer().setClass ('csscontent');
            lyrPanelBar2.getMenuLayer().setClass ('cssmenu');
            
            // Just test the empty constructor
            // This is important for subclassing
            var constructorTest = new PanelBar();
            
            dynapi.document.addChild(lyrPanelBar);
            dynapi.document.addChild(lyrPanelBar1);
            dynapi.document.addChild(lyrPanelBar2);
            
            var objStacker = new Stacker()
            objStacker.add(lyrPanelBar);
            objStacker.add(lyrPanelBar1);
            objStacker.add(lyrPanelBar2);
        
        
    
    
        
    

           
       
dynapi.zip( 791 k)