I have a menu on each of my pages which works fine.
I now want to have a new additional menu on one of the pages which will be always on whenever that page is viewed.
How do I do that?
Multiple Menus
-
- Beginner
- Posts: 2
- Joined: Fri Jul 16, 2004 1:01 pm
- Location: Ontario, Canada
- Contact:
Duplicate a menu giving it a new menu name and style if necessary.
Then match the page with an if and else{ statement if necessary.
Around this new menu, or if you wanted it around menu items, place this:
if (location.pathname == "/"){
.......
.......
......
}
else{
......
......
}
This example will feed the if statement only to the index page.
If you don't have an else then leave it off.
Realize that this is being wrapped around existing {...}
So if it ends with a }
It will look like this
}
}
maz
Then match the page with an if and else{ statement if necessary.
Around this new menu, or if you wanted it around menu items, place this:
if (location.pathname == "/"){
.......
.......
......
}
else{
......
......
}
This example will feed the if statement only to the index page.
If you don't have an else then leave it off.
Realize that this is being wrapped around existing {...}
So if it ends with a }
It will look like this
}
}
maz
Do you want to have an additional as in a different menu in addition to the one that is on there? So you would have two different menus on the page in two different places? If that is what you want, make a new menu_data.js file with all this menu's information in it, name it differently, for example if the menu is going to be on page3.htm you might name it page3_data.js. Then in your calls put in a call for that file also.
Ruth
Code: Select all
<SCRIPT language=JavaScript src="milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu_data.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript src="page3_data.js" type=text/javascript></SCRIPT>
Ruth
-
- Beginner
- Posts: 2
- Joined: Fri Jul 16, 2004 1:01 pm
- Location: Ontario, Canada
- Contact:
Another little thing I forgot to mention. If you make a new data file, make sure you don't name the menus by the same names as in the original data file. They have to be different names so nothing gets confused. I.E. if you had a submenu called links in the first file and also in the second file, which one should the menu program open. I'm not sure how it would decide but it would only open one, I think. Probably the first one it 'reads'.
Ruth
Ruth