Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mm_menu.js? how is the numbers assigned

Status
Not open for further replies.

marianmarian

Programmer
Jan 17, 2003
40
0
0
CA
Hello all,

hopefully someone can help me understand this mm_menu.js from dreamweaver.

I am trying to add an extra drop down menu to an already existing mm_menu.js.

my question is how does this numbers get assigned "0330094751_" Do you just pick them?

the reason i asked is that mm_menu.js was created by our previous developer using dreamweaver, and i am a homesite fun, so i do all my codings etc from homesite, and if it was left with me, i would have used/created a different menu.js, but it is already done and i need to add one more drop drop down menu to the already existing menu, and this is what i did below....the image tag works fine on the browser etc...but when i put my mouse over the image, there is no drop down menu, i only get a javascript error that "menu layer is null or not an object"

i have tried everything to manipulate that 10 digit numbers but i get no where...

so if someone who knows this assignment of the 10 digit numbers really well and don't mind explaining it to me, i will really appreciate it.

thanks alot!!

Marianmarian


/**this is the menus i want to add********************/
window.mm_menu_0330094751_0 = new Menu("root",166,16,"Arial, Helvetica, sans-serif",12,"#ffffff","#ffcc00","#000000","#cc3333","left","middle",2,0,2000,-5,7,true,false,true,0,true,true);
mm_menu_0330094751_0.addMenuItem("testing","location='testing'");
mm_menu_0330094751_0.addMenuItem("testing","location='testing'");
mm_menu_0330094751_0.addMenuItem("testing","location='testing'");
mm_menu_0330094751_0.hideOnMouseOut=true;
mm_menu_0330094751_0.bgColor='#000000';
mm_menu_0330094751_0.menuBorder=0;
mm_menu_0330094751_0.menuLiteBgColor='#ffcc00';
mm_menu_0330094751_0.menuBorderBgColor='#000000';
/**this is the menus i want to add********************/
 
Marianmarian -
I think I can help with your Dreamweaver Javascript mm_menu problem, although I can't tell you exactly how Dreamweaver MX comes up with the 10-digit menu name. Below is what I did to manually alter an .html file in TextPad in order to modify and add Javascript drop-down menus without having access to Dreamweaver MX.

First, I took an existing mm_menu sequence from the code, such as:

window.mm_menu_0325135617_0 = new Menu("root",274,18,"Arial, Helvetica, sans-serif",12,"#000000","#FFFFFF","#CCCCCC","#00365B","left","middle",3,2,2000,-5,7,true,true,true,0,true,true);
mm_menu_0325135617_0.addMenuItem("Dogs","window.open(dogs.htm', '_blank');");
mm_menu_0325135617_0.addMenuItem("Cats","window.open('cats.htm', '_blank');");
mm_menu_0325135617_0.addMenuItem("Birds","window.open('birds.htm', '_blank');");
mm_menu_0325135617_0.addMenuItem("Fish","window.open('fish.htm', '_blank');");
mm_menu_0325135617_0.hideOnMouseOut=true;
mm_menu_0325135617_0.bgColor='#999999';
mm_menu_0325135617_0.menuBorder=1;
mm_menu_0325135617_0.menuLiteBgColor='#999999';
mm_menu_0325135617_0.menuBorderBgColor='#000000';

Next, I simply made up a new 10-digit number that was about 40000 larger than the previous mm_menu ID, which in this case would be about 0325175617. I copied the code seen above and added it to the end of my existing mmLoadMenus script, before this: } // mmLoadMenus (). I then replaced the existing 10-digit identifier with my made-up identifier and made changes within my new script, such as change "Cats" to "leashes" and "cats.htm" to "leashes.htm" to reflect the new drop-down menu that I wanted. I had to do this with each new or changed drop down item. With me so far?

But wait, there's more!

In the HTML body of my webpage, I had to change (or add) HTML where this JavaScript behavior would occur when a particular hyperlink or icon was clicked upon. Below is an example of what I had to change (or add) in my HTML to go along with the changes I made to the JavaScript above:

<p><img src=&quot;pettypes.gif&quot; name=&quot;Pets We Carry&quot; width=&quot;147&quot; height=&quot;25&quot; id=&quot;PetsWeCarry&quot; onClick=&quot;MM_showMenu(window.mm_menu_0325135617_0,0,25,null,'PetsWeCarry')&quot; onMouseOut=&quot;MM_startTimeout();&quot;></p>

I would then have to add similar code to the end of my HTML for my new JavaScript drop-down menu (0325175617), or modify the existing HTML to reflect changes to the existing menu, 0325135617.

Save in your text editor (I use TextPad), and preview in your browser! It's really a lot easier than you think!

Hope this helps,
Arizonan
 
Similar question, if I had a menu that had two sub menus on it but now they need to go, how do I do this?
For example:

Code:
window.mm_menu_0715105511_0 = new Menu(&quot;root&quot;,157,15,&quot;Verdana, Arial, Helvetica, sans-serif&quot;,9,&quot;#FFFFFF&quot;,&quot;#FFFFFF&quot;,&quot;#6699CC&quot;,&quot;#99CCFF&quot;,&quot;left&quot;,&quot;middle&quot;,3,0,100,-5,7,true,true,true,0,true,true);
  mm_menu_0715105511_0.addMenuItem(&quot;Interactive Map&quot;);
  mm_menu_0715105511_0.addMenuItem(&quot;List of Coop Members&quot;);
  mm_menu_0715105511_0.addMenuItem(&quot;Are you in a coop?&quot;);
   mm_menu_0715105511_0.hideOnMouseOut=true;
   mm_menu_0715105511_0.bgColor='#555555';
   mm_menu_0715105511_0.menuBorder=1;
   mm_menu_0715105511_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0715105511_0.menuBorderBgColor='#999999';

needs to have the two sub menus removed:
[COLOR=red]
mm_menu_0715105511_0.addMenuItem(&quot;List of Coop Members&quot;);
mm_menu_0715105511_0.addMenuItem(&quot;Interactive Map&quot;);
[/color]

I tried to enter:
if (window.mm_menu_0715105511_0) return;

but I get errors....
any thoughts,
BrennyGirl
 
BrennyGirl,
Can't you just go in and delete the two lines you want to get rid of? That usually works for me - I can add and delete lines of menu JavaScript code and the corresponding menu items are added and/or deleted from their particular menus.

Is this what you're aiming for?

Arizonan
 
I figured out my problem, I was using &quot;onMouseOver=&quot;MM_showMenu&quot;. The minute I removed this, wallla!

thx,
joe'l
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top