Login

Save Password - Forgot Pass?
Not a member?
Become a DC
member now!



         Setting up CoolMenus 3
  • Downloading and using the code
  • Making the Menu Object
  • Other Default Settings
  • Background Bar Settings
  • Placement Properties
  • Level Properties
  • Setting the Menu Variables
  • Customising the Menus by Over-riding the defaults
  • Putting Your Completed Menu On-line
  • Support
      Rate this tutorial:
    This tutorial have been read 4103 times.

    Print-friendly version

  • Setting up CoolMenus 3
    Written 02/07/2002 by Matthew Wombell. Last updated 02/07/2002.


    Setting the Menu Variables

    The Code in the original looks similar to:

    oCMenu.makeMenu('top0',',' News','/news/index.asp',')
     oCMenu.makeMenu('sub00','top0','Newest news','/news/index.asp')
    	oCMenu.makeMenu('sub001','sub00','- New DHTML API released')
    	oCMenu.makeMenu('sub002','sub00','- Explorer 7 is out')
    	oCMenu.makeMenu('sub003','sub00','- Opera 6 supports innerHTML')
     oCMenu.makeMenu('sub01','top0','News archive','/news/archive.asp')
    	
    oCMenu.makeMenu('top1',',' Scripts','/scripts/index.asp')
     oCMenu.makeMenu('sub10','top1','New scripts','/index.asp?show=new')
     oCMenu.makeMenu('sub11','top1','All scripts','/index.asp?show=all')
     oCMenu.makeMenu('sub12','top1','Popular scripts','/index.asp?show=pop')
    	
    oCMenu.makeMenu('top2',',' Articles','/articles/index.asp')
     oCMenu.makeMenu('sub21','top2','Tutorials','/tutorials/index.asp')
    	oCMenu.makeMenu('sub210','sub21','New tutorials','/tutorials/index.asp')
    	oCMenu.makeMenu('sub211','sub21','Tutorials archive','/archive.asp')
     oCMenu.makeMenu('sub22','top2','Other articles','/index.asp')
    	oCMenu.makeMenu('sub220','sub22','New articles','/index.asp?show=new')
    	oCMenu.makeMenu('sub221','sub22','Article archive','/archive.asp')
    
    oCMenu.makeMenu('top3',',' Forums','/forums/')
     oCMenu.makeMenu('sub30','top3','General','/forums/forum.asp')
     oCMenu.makeMenu('sub31','top3','Scripts','/forums/forum.asp')
     oCMenu.makeMenu('sub32','top3','Crossbrowser','/forums/forum.asp')
     oCMenu.makeMenu('sub33','top3','CoolMenus','/forums/forum.asp')
     oCMenu.makeMenu('sub34','top3','dhtmlcentral.com','/forums/forum.asp')
     oCMenu.makeMenu('sub35','top3','Cool sites','/forums/forum.asp')
    
    oCMenu.makeMenu('top5',',' CoolMenus','/coolmenus/index.asp')
     oCMenu.makeMenu('sub50','top5','Examples','/examples.asp')
    	oCMenu.makeMenu('sub500','sub50','With frames','show=with')
    	oCMenu.makeMenu('sub501','sub50','Without frames','/show=without')
     oCMenu.makeMenu('sub51','top5','Download','download.asp')
    	oCMenu.makeMenu('sub510','sub51','Download','download.asp',',150,40)
     oCMenu.makeMenu('sub52','top5','Tutorial','tutorial.asp')
    	oCMenu.makeMenu('sub520','sub52','how to set','/tutorial.asp',',150,40)
     oCMenu.makeMenu('sub53','top5','MenuMaker',',',0,0,',',',',',',
        'window.open("/coolmenus/maker/","","width=800,height=600")')
     oCMenu.makeMenu('sub54','top5','FAQ','/coolmenus/faq.asp')
     oCMenu.makeMenu('sub55','top5','Help forum','/forums/forum.asp')
    
    

    This is reasonably straightforward to understand. Each of the top menus take a value:
    oCMenu.makeMenu('top0',',' Whatever',')
    Where 'topX' is number of the top-level item The ' in-between the ,'s relate to one of the customisation of the script (to over-ride the defaults), which is explained in detail in the next step
    The ' Whatever' is the text that is shown in the box The next set of ' is again customisation of the script
    Each of the submenus takes the appearance of:
    oCMenu.makeMenu('sub00','top0','New Scripts','/scripts/index.asp?show=new')
    The 'sub10' value is the number of the menu i.e. 0 etc. followed by the number of the submenu at the top, i.e. 0
    The 'top0' relates to the number of the menu that the sub-menu appears under
    'New Scripts' is the text that goes into the box
    '/scripts/index.asp?show=new' is the link that the box makes
    The 3rd level of submenus are:
    oCMenu.makeMenu('sub0000','sub000','sub1/subsub1/test1.html','sub1/subsub1/test1.html')
    This example have been altered, but the submenu that is the one here has the following coding:

    'sub0000' is the menu number, the first 0 is for the number of the top menu, the second is the number of the sub-menu (level 1), the third being the number of the level 2 menu
    'sub000' is the sub-menu that this menu is relative to
    For each extra menu you add, you can follow the clear(er) instructions that are in the code itself.

    « Level PropertiesCustomising the Menus by Over-riding the defaults »

    Copyright ©2000-2002 DHTMLCentral.com, Bratta Communications. All rights reserved.