SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    <?php echo(witty title)?> Sal Petrarca's Avatar
    Join Date
    Apr 2002
    0 Post(s)
    0 Thread(s)

    Javascript looking for what's not there!

    I am using the following JavaScript to build a navigation bar for the site I'm currently working on...and IE keeps coming back telling me that "Menu_1_7_2 Is Undefined", but neither do I have, nor need a Menu_1_7_2....

    	var NoOffFirstLineMenus=5;			// Number of first level items
    	var LowBgColor='orangered';			// Background color when mouse is not over
    	var LowSubBgColor='orangered';			// Background color when mouse is not over on subs
    	var HighBgColor='black';			// Background color when mouse is over
    	var HighSubBgColor='black';			// Background color when mouse is over on subs
    	var FontLowColor='white';			// Font color when mouse is not over
    	var FontSubLowColor='white';			// Font color subs when mouse is not over
    	var FontHighColor='white';			// Font color when mouse is over
    	var FontSubHighColor='white';			// Font color subs when mouse is over
    	var BorderColor='black';			// Border color
    	var BorderSubColor='black';			// Border color for subs
    	var BorderWidth=1;				// Border width
    	var BorderBtwnElmnts=1;			// Border between elements 1 or 0
    	var FontFamily="arial,comic sans ms,technical"	// Font family menu items
    	var FontSize=9;				// Font size menu items
    	var FontBold=1;				// Bold menu items 1 or 0
    	var FontItalic=0;				// Italic menu items 1 or 0
    	var MenuTextCentered='left';			// Item text position 'left', 'center' or 'right'
    	var MenuCentered='left';			// Menu horizontal position 'left', 'center' or 'right'
    	var MenuVerticalCentered='top';		// Menu vertical position 'top', 'middle','bottom' or static
    	var ChildOverlap=.2;				// horizontal overlap child/ parent
    	var ChildVerticalOverlap=.2;			// vertical overlap child/ parent
    	var StartTop=240;				// Menu offset x coordinate
    	var StartLeft=1;				// Menu offset y coordinate
    	var VerCorrect=0;				// Multiple frames y correction
    	var HorCorrect=0;				// Multiple frames x correction
    	var LeftPaddng=3;				// Left padding
    	var TopPaddng=2;				// Top padding
    	var FirstLineHorizontal=0;			// SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
    	var MenuFramesVertical=1;			// Frames in cols or rows 1 or 0
    	var DissapearDelay=1000;			// delay before menu folds in
    	var TakeOverBgColor=1;			// Menu frame takes over background color subitem frame
    	var FirstLineFrame='navig';			// Frame where first level appears
    	var SecLineFrame='space';			// Frame where sub levels appear
    	var DocTargetFrame='space';			// Frame where target documents appear
    	var TargetLoc='';				// span id for relative positioning
    	var HideTop=0;				// Hide first level when loading new document 1 or 0
    	var MenuWrap=1;				// enables/ disables menu wrap 1 or 0
    	var RightToLeft=0;				// enables/ disables right to left unfold 1 or 0
    	var UnfoldsOnClick=0;			// Level 1 unfolds onclick/ onmouseover
    	var WebMasterCheck=0;			// menu tree checking on or off 1 or 0
    	var ShowArrow=1;				// Uses arrow gifs when 1
    	var KeepHilite=1;				// Keep selected path highligthed
    	var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10];	// Arrow source, width and height
    function BeforeStart(){return}
    function AfterBuild(){return}
    function BeforeFirstOpen(){return}
    function AfterCloseAll(){return}
    // Menu tree
    //	MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width);
    //	For rollover images set "Text to show" to:  "rollover:Image1.jpg:Image2.jpg"
    Menu1=new Array("Administration","","",7,20,165);
            Menu1_1=new Array("WWPS Home Page","","",0,20,205);
            Menu1_2=new Array("Superintendant of Schools","","",5,20,205);
                    Menu1_2_1=new Array("Greetings from Mr. Raiche","","",0,20,205);
                    Menu1_2_2=new Array("WWPS Strategic Goals","","",0,20,205);
                    Menu1_2_3=new Array("Meet the Directors","","",0,20,205);
                    Menu1_2_4=new Array("2002-2003 School Year Calendar","","",0,20,205);
                    Menu1_2_5=new Array("Volunteers (WWEAV)","","",0,20,195);
            Menu1_3=new Array("Director of Administration","","",0,20,205);
            Menu1_4=new Array("Director of School Improvement","","",2,20,195);
                     Menu1_4_1=new Array("A Message from Dr. Hannigan","","",0,20,195);
                     Menu1_4_2=new Array("Employment Forms","","",0,20,205);
            Menu1_5=new Array("Director of Special Education","","",3,20,205);
                    Menu1_5_1=new Array("A Message from Ms. Roolf-Rothwell","","",0,20,205);
                    Menu1_5_2=new Array("Special Education Policies","","",0,20,205);
                    Menu1_5_3=new Array("Staff E-mail Directory","","",0,20,205);
            Menu1_6=new Array("Curriculum Links","","",2,20,205);
                    Menu1_6_1=new Array("Math Curriculum","","",0,20,205);
                    Menu1_6_2=new Array("English Curriculum","","",0,20,205);
            Menu1_7=new Array("Director of Teaching & Learning","",1,20,205);
                    Menu1_7_1=new Array("A Message From Ms. Fortin","","",0,20,205);
    The text goes in the tags the following way...

    Section name, location, background image, subtopics, height, and width....
    Sites:Dark Moon Rising:::My Site

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    0 Post(s)
    0 Thread(s)
    certainly this is not all of the source code... is it?

  3. #3
    <?php echo(witty title)?> Sal Petrarca's Avatar
    Join Date
    Apr 2002
    0 Post(s)
    0 Thread(s)
    Nope. Just the part that's giving me trouble.
    Sites:Dark Moon Rising:::My Site

  4. #4
    SitePoint Member
    Join Date
    Jun 2002
    0 Post(s)
    0 Thread(s)

    Hello! I am new here but I was looking at your code and I think your menu code that you posted is working correctly but that somewhere later in your code (not posted) you probably have a loop of some kind that is trying to find one to many menu items. This is just a guess but you could test my theory by adding another menu item:
    Menu1_7_2=new Array("Another message.","","",0,20,205);

    And then see if the error returns "Menu_1_7_3 Is Undefined"
    As I said before its really hard to tell without seeing the entire code. Maybe you could post a link with the entire code.


    - Confused? Have another drink.

  5. #5
    <?php echo(witty title)?> Sal Petrarca's Avatar
    Join Date
    Apr 2002
    0 Post(s)
    0 Thread(s)
    Yep, I already tried that idea. It worked fine until I tried to add that 7th array...

    The second half of the code is

    Menu2=new Array("News","blank.htm","",2);
    	Menu2_1=new Array("General","blank.htm","",5,20,150);	
    		Menu2_1_1=new Array("CNN","","",0,20,150);
    		Menu2_1_2=new Array("ABCNews","","",0);
    		Menu2_1_3=new Array("MSNBC","","",0);
                    Menu2_1_4=new Array("CBSNews","","",0);
                    Menu2_1_5=new Array("Canadian News","","",2);
                              Menu2_1_5_1=new Array("Vancouver Sun","","",0,20,150);
                              Menu2_1_5_2=new Array("CTV News","","",0);
    	Menu2_2=new Array("Technology","blank.htm","",3);
    		Menu2_2_1=new Array("TechWeb","","",0,20,200);
    		Menu2_2_2=new Array("","","",0);
    		Menu2_2_3=new Array("Wired News","","",0);
    Menu3=new Array("Search Engines","blank.htm","",3);
    	Menu3_1=new Array("Altavista","","",0,20,150);
    	Menu3_2=new Array("Google","","",0);
    	Menu3_3=new Array("Yahoo","","",0);
    Menu4=new Array("Webmaster","blank.htm","",4);
    	Menu4_1=new Array("Dynamic Drive","","",0,20,180);
    	Menu4_2=new Array("JavaScript Kit","","",0);
    	Menu4_3=new Array("Freewarejava","","",0);
    	Menu4_4=new Array("Web Review","","",0);
    Menu5=new Array("Other","javascript:top.location.href='blank.htm'","",1);
    	Menu5_1=new Array("Author\'s Site","","",0,20,140);
    And the otehr part of the script (another external file) is here...
    Sites:Dark Moon Rising:::My Site


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts