JavaScript.CoolDev.Com Support Forums
Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com
| Author |
Message |
fontaholic
Joined: 22 Nov 2003 Posts: 6
|
Posted: Sun Nov 30, 2003 8:22 pm Post subject: menuitems.js work in CoolMenu, but not CoolMenuPRO |
|
|
Hi,
I started working in CoolMenu and got my menu as far as I could before I realized what I really wanted was CoolMenuPRO. After getting that all squared away, I've gotten the PRO version and have replaced the coolmenu.js file with coolmenupro.js in my tree (and head) and put the correct (?) call before the </body>: | Code: | <script type="text/javascript">
var menu = new COOLjsMenuPro("MainMenu", MENU_ITEMS);
menu.initTop();
menu.init();
</script> |
but now my menu doesn't show up. i don't really want to start again from scratch!! the non-pro version was beginning to work here:
http://www.home.earthlink.net/~lisameg/newsite/
can anyone tell me what i need to adjust in the files to get the original menuitems.js working with the pro version? i'm ready to start doing better border stuff and place my nav in a table and get this site finished!
fontaholic |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Mon Dec 01, 2003 10:37 pm Post subject: |
|
|
| Is there "menu.show()" call before the </body> tag in your HTML code? It must be there - or menu will not be shown. |
|
| Back to top |
|
 |
Guest
|
Posted: Thu Dec 04, 2003 12:58 am Post subject: added that... still not showing :( |
|
|
thanks alex, any help you can offer is greatly appreciated.
fontaholic
i have this in my head:
<script type="text/javascript" src="js/coolmenupro.js"></script>
<script type="text/javascript" src="js/menuitems.js"></script>
and (now) this right before </body>
<script type="text/javascript">
var menu = new COOLjsMenuPro("MainMenu", MENU_ITEMS);
menu.show();
menu.initTop();
menu.init();
</script>
my menuitems.js looks like this:
| Code: | //keywords
var code="code";var url="url";var sub="sub";
//styles
var color = {"border":"#CC66FF", "bgON":"#CC66FF","bgOVER":"#FFFF8B"};
var css = {"ON":"clsCMOn", "OVER":"clsCMOver"};
var STYLE = {"border":0, "color":color, "css":css};
//items and formats
var MENU_ITEMS =
[
{"pos":[0,50], "itemoff":[0,133], "leveloff":[27,0], "style":STYLE, "size":[28,133]},
{code:"THE STUDIO", url:"/studio/index.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[29,0]},
{code:"Directions", url:"/studio/index.html"},
{code:"Teachers", url:"/studio/teachers.html"},
{code:"Contact Us", url:"/studio/contact.html"},
{code:"Articles", url:"/studio/articles.html"}
]
},
{code:"YOGA CLASSES", url:"/yoga/index.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Description", url:"/yoga/index.html"},
{code:"Schedule", url:"/yoga/schedule.html"},
{code:"Fees & Policies", url:"/yoga/fees.html"},
{code:"Registration", url:"/yoga/registration.html"}
]
},
{code:"WORKSHOPS", url:"/workshops/index.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Description", url:"/workshops/index.html"},
{code:"Registration", url:"/workshops/registration.html"}
]
},
{code:"SCHEDULE", url:"/yoga/schedule.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Yoga Classes", url:"/yoga/schedule.html"},
{code:"Workshops" url:"/workshops/index.html"},
]
},
{code:"CONTACT US", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Yoga Classes", url:"test.html"},
{code:"Workshops"},
]
},
]; |
|
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Sat Dec 06, 2003 11:37 am Post subject: |
|
|
The correct order is:
| Code: | <script type="text/javascript">
var menu = new COOLjsMenuPro("MainMenu", MENU_ITEMS);
menu.initTop();
menu.init();
menu.show();
</script> |
|
|
| Back to top |
|
 |
fontaholic
Joined: 22 Nov 2003 Posts: 6
|
Posted: Thu Dec 11, 2003 12:38 am Post subject: :( |
|
|
wah! it's still not working!
help! |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Sun Dec 14, 2003 7:25 am Post subject: |
|
|
Aga. Now I see.
Corrected code is:
| Code: | <script type="text/javascript">
var menu = new COOLjsMenuPRO("MainMenu", MENU_ITEMS_SIZING);
menu.initTop();
menu.init();
menu.show();
</script> |
"MENU_ITEMS_SIZING" instead od "MENU_ITEMS", and also "PRO" in capitals. |
|
| Back to top |
|
 |
fontaholic
Joined: 22 Nov 2003 Posts: 6
|
Posted: Sun Dec 14, 2003 3:39 pm Post subject: Re: added that... still not showing :( |
|
|
do i also need to change this in my menuitems file?
| Quote: | //items and formats
var MENU_ITEMS =
|
|
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Sun Dec 14, 2003 5:51 pm Post subject: |
|
|
| Yes, you need to. I've used "MENU_ITEMS_SIZING" because that variable was used in you online version with COOLjsMenu - I was sure that you will take same menuitems.js file. |
|
| Back to top |
|
 |
fontaholic
Joined: 22 Nov 2003 Posts: 6
|
Posted: Sun Dec 14, 2003 7:18 pm Post subject: ugh! |
|
|
ok... this is getting frustrating. it's still not working, and i have a ton to do on this project!
now i have this in my head.
| Code: |
<head>
<title>TEST NAV</title>
<link rel="stylesheet" type="text/css" href="css/cfy.css">
<link rel="stylesheet" type="text/css" href="css/nav.css">
<script type="text/javascript" src="js/coolmenupro.js"></script>
<script type="text/javascript" src="js/menuitems.js"></script>
</head>
<body>
|
and this before the end body
| Code: |
<script type="text/javascript">
var menu = new COOLjsMenuPRO("MainMenu", MENU_ITEMS_SIZING);
menu.initTop();
menu.init();
menu.show();
</script>
</body>
|
and this in my menuitems.js file
| Code: |
//keywords
var code="code";var url="url";var sub="sub";
//styles
var color = {"border":"#CC66FF", "bgON":"#CC66FF","bgOVER":"#FFFF8B"};
var css = {"ON":"clsCMOn", "OVER":"clsCMOver"};
var STYLE = {"border":0, "color":color, "css":css};
//items and formats
var MENU_ITEMS_SIZING =
[
{"pos":[0,50], "itemoff":[0,133], "leveloff":[27,0], "style":STYLE, "size":[28,133]},
{code:"THE STUDIO", url:"/studio/index.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[29,0]},
{code:"Directions", url:"/studio/index.html"},
{code:"Teachers", url:"/studio/teachers.html"},
{code:"Contact Us", url:"/studio/contact.html"},
{code:"Articles", url:"/studio/articles.html"}
]
},
{code:"YOGA CLASSES", url:"/yoga/index.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Description", url:"/yoga/index.html"},
{code:"Schedule", url:"/yoga/schedule.html"},
{code:"Fees & Policies", url:"/yoga/fees.html"},
{code:"Registration", url:"/yoga/registration.html"}
]
},
{code:"WORKSHOPS", url:"/workshops/index.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Description", url:"/workshops/index.html"},
{code:"Registration", url:"/workshops/registration.html"}
]
},
{code:"SCHEDULE", url:"/yoga/schedule.html", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Yoga Classes", url:"/yoga/schedule.html"},
{code:"Workshops" url:"/workshops/index.html"},
]
},
{code:"CONTACT US", "format":{"size":[28,133]},
sub:[
{"itemoff":[27,0]},
{code:"Yoga Classes", url:"test.html"},
{code:"Workshops"},
]
},
];
|
i totally appreciate your help alex. once i can see the nav i created with the non-pro version, i'm sure i'll have more questions for you. i'm sorry to be such a pain!
fontaholic |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Mon Dec 15, 2003 9:47 am Post subject: |
|
|
I've combined your HTML code into index.html, added "js" subfolder, copied coolmenupro.js into that folder, and created "js/menuitems.js" file by pasting your quotet JS. There was one problem - missing comma on the following line:
| Code: | | {code:"Workshops" url:"/workshops/index.html"}, |
It must be:
| Code: | | {code:"Workshops", url:"/workshops/index.html"}, |
That was the only problem - after fixing it menu works just fine. |
|
| Back to top |
|
 |
fontaholic
Joined: 22 Nov 2003 Posts: 6
|
Posted: Tue Dec 16, 2003 12:45 pm Post subject: YAY! |
|
|
amazing how one little comma can cause so much angst. i'd looked it over dozens of times too. thanks for figuring it out. now i'll start playing around with the pro features -- and probably have more questions!
thanks alex!
fontaholic |
|
| Back to top |
|
 |
|
|