JavaScript.CoolDev.Com Support Forums

Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

menuitems.js work in CoolMenu, but not CoolMenuPRO

 
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu
Author Message
fontaholic



Joined: 22 Nov 2003
Posts: 6

PostPosted: Sun Nov 30, 2003 8:22 pm    Post subject: menuitems.js work in CoolMenu, but not CoolMenuPRO Reply with quote

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!

Smile fontaholic
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Mon Dec 01, 2003 10:37 pm    Post subject: Reply with quote

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






PostPosted: Thu Dec 04, 2003 12:58 am    Post subject: added that... still not showing :( Reply with quote

thanks alex, any help you can offer is greatly appreciated.

Smile 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

PostPosted: Sat Dec 06, 2003 11:37 am    Post subject: Reply with quote

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

PostPosted: Thu Dec 11, 2003 12:38 am    Post subject: :( Reply with quote

wah! it's still not working!

help!
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Sun Dec 14, 2003 7:25 am    Post subject: Reply with quote

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

PostPosted: Sun Dec 14, 2003 3:39 pm    Post subject: Re: added that... still not showing :( Reply with quote

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

PostPosted: Sun Dec 14, 2003 5:51 pm    Post subject: Reply with quote

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

PostPosted: Sun Dec 14, 2003 7:18 pm    Post subject: ugh! Reply with quote

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!

Smile fontaholic
Back to top
AlexKunin
Developer


Joined: 03 Jan 2003
Posts: 1191

PostPosted: Mon Dec 15, 2003 9:47 am    Post subject: Reply with quote

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

PostPosted: Tue Dec 16, 2003 12:45 pm    Post subject: YAY! Reply with quote

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!

Smile fontaholic
Back to top
Display posts from previous:   
Post new topic   Reply to topic    JavaScript.CoolDev.Com Forum Index -> COOLjsMenu All times are GMT
Page 1 of 1