PDA

View Full Version : dropdown menu



loh
09-14-2006, 05:13 AM
Hi...I just took over a job (voluntarily) to maintaince a website for a non profit organisation. Was asked to add an extra dropdown menu to an existing one.

M able to figure out the problem (need to edit the mm_menu.js) but I don't know where about. Can anyone help?

Thanks.

Loh

codeexploiter
09-14-2006, 12:30 PM
Can you share the code of mm_menu.js? I don't think nobody won't be able to help you without that

loh
09-15-2006, 04:46 AM
Here's the mm_menu.js file....

Loh

jscheuer1
09-15-2006, 07:54 AM
That looks like one of at least two files for a javascript menu. The one that we would need to see would be the config file:

mm_menu_config.js

or something, it really could be named almost anything. Also helpful to know is, as you say you want to drop off of an existing drop down, do you mean drop down another level or just add another item at the existing level? If you want to add another level, some menus of this sort can only go one or two levels deep.

loh
09-15-2006, 08:46 AM
Hmmm....I don't think I've another js file. Sorry....I took over a volunteer work (to maintain a website on behalf of a non profit organisation)

Please visit this site www.itla-toylibraries.org

Am thinking of adding a drop down menu between the "wpd" and "link".

I managed to figure out that I need to create some gif files to use as a button, and realised that I need to do something to the mm_menu.js

Loh

codeexploiter
09-15-2006, 09:34 AM
Please following the steps furnished below to change your main menu/sub menus

Please load your site's home page and right click just above of your header menus and select view source.

Actually your home page contains two frames and loaded two pages ie TOP.HTM and main.htm

TOP.HTM is the one that handles the header menu part. Please check the source code of the TOP.HTM file

All the header menu items are image based ones. If you want to change those items then you need the new menu images.

From TOP.HTM


<td width="58" rowspan="2"><a href="#" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_0109002736_0,0,12,null,'top_r2_c2');"><img name="top_r2_c2" src="top_r2_c2.jpg" width="58" height="11" border="0" alt=""></a></td>

The above is from your TOP.HTM page which is your about us header menu. top_r2_c2 is the header menu image

If you want to change your submenus then please check the client-side Javascript furnished in the HEAD section of the page, for example the below mentioned code represent the submenus of your about us header menu

FROM TOP.HTM



window.mm_menu_0109002736_0 = new Menu("root",123,16,"Verdana, Arial, Helvetica, sans-serif",10,"#999999","#333333","#ffffff","#ffffff","left","middle",3,0,30000,-5,7,true,true,true,0,true,true);
mm_menu_0109002736_0.addMenuItem("presidents&nbsp;message","window.open('pm.htm', 'mainFrame');");
mm_menu_0109002736_0.addMenuItem("who&nbsp;are&nbsp;we","window.open('au.htm', 'mainFrame');");
mm_menu_0109002736_0.addMenuItem("our&nbsp;aims","window.open('ouraims.htm', 'mainFrame');");
mm_menu_0109002736_0.addMenuItem("board&nbsp;members","window.open('bm.htm', 'mainFrame');");


You can find other submenus that are associated to other header menus other than about us in the TOP.HTM

Now I think you'll get the idea, whatever changes you want to make in the submenus can be done in the required section like the one i mentioned above.

If you examine the code further


mm_menu_0109002736_0.addMenuItem("presidents&nbsp;message","window.open('pm.htm', 'mainFrame');");

This is the first submenu item of about us header menu


"presidents&nbsp;message" is the submenu title which you want to display to the users


window.open('pm.htm', 'mainFrame')

Whenever the user clicks on this submenu item then it will open a file named PM.HTM in the mainFrame used in the home page.

Hope this will do the job, please let us know if there is any problem in there

jscheuer1
09-15-2006, 09:49 AM
Yes, what codeexploiter said looks about right. By way of explanation - with these sorts of menus this:


<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0109002736_0) return;
window.mm_menu_0109002736_0 = new Menu("root",123,16,"Verdana, Arial, Helvetica, sans-serif",10,"#999999","#333333","#ffffff","#ffffff","left","middle",3,0,30000,-5,7,true,true,true,0,true,true);
mm_menu_0109002736_0.addMenuItem("presidents&nbsp;message","window.open('pm.htm', 'mainFrame');");
mm_menu_0109002736_0.addMenuItem("who&nbsp;are&nbsp;we","window.open('au.htm', 'mainFrame');");
mm_menu_0109002736_0.addMenuItem("our&nbsp;aims","window.open('ouraims.htm', 'mainFrame');");
mm_menu_0109002736_0.addMenuItem("board&nbsp;members","window.open('bm.htm', 'mainFrame');");
<!--mm_menu_0109002736_0.bgImageUp="mmmenu4_123x16_up.gif";
<!--mm_menu_0109002736_0.bgImageOver="mmmenu4_123x16_over.gif";
mm_menu_0109002736_0.fontWeight="bold";
mm_menu_0109002736_0.hideOnMouseOut=true;
mm_menu_0109002736_0.bgColor='#999999';
window.mm_menu_0109002736_1 = new Menu("root",130,16,"Verdana, Arial, Helvetica, sans-serif",10,"#999999","#333333","#ffffff","#ffffff","left","middle",80,0,30000,-5,7,true,true,true,0,true,true);
mm_menu_0109002736_1.addMenuItem("ITLA&nbsp;newsletter","window.open('newsletter.htm', 'mainFrame');");
mm_menu_0109002736_1.addMenuItem("ITLA&nbsp;documentation&nbsp;center","window.open('dc.htm', 'mainFrame');");
mm_menu_0109002736_1.addMenuItem("conference&nbsp;papers","window.open('conference.htm', 'mainFrame');");
mm_menu_0109002736_1.addMenuItem("research&nbsp;papers","window.open('research.htm', 'mainFrame');");
<!--mm_menu_0109002736_1.bgImageUp="mmmenu3_165x16_up.gif";
<!--mm_menu_0109002736_1.bgImageOver="mmmenu3_165x16_over.gif";
mm_menu_0109002736_1.fontWeight="bold";
mm_menu_0109002736_1.hideOnMouseOut=true;
mm_menu_0109002736_1.bgColor='#999999';
window.mm_menu_0109002736_2 = new Menu("root",100,16,"Verdana, Arial, Helvetica, sans-serif",10,"#999999","#333333","#ffffff","#ffffff","left","middle",150,0,30000,-5,7,true,true,true,0,true,true);
mm_menu_0109002736_2.addMenuItem("8th.&nbsp;international&nbsp;conference","window.open('8ic.htm', 'mainFrame');");
mm_menu_0109002736_2.addMenuItem("9th.&nbsp;international&nbsp;conference","window.open('9ic.htm', 'mainFrame');");
mm_menu_0109002736_2.addMenuItem("10th.&nbsp;international&nbsp;conference","window.open('10ic.htm', 'mainFrame');");
mm_menu_0109002736_2.addMenuItem("related&nbsp;stories","window.open('rs.htm', 'mainFrame');");
<!--mm_menu_0109002736_2.bgImageUp="mmmenu2_175x16_up.gif";
<!--mm_menu_0109002736_2.bgImageOver="mmmenu2_175x16_over.gif";
mm_menu_0109002736_2.fontWeight="bold";
mm_menu_0109002736_2.hideOnMouseOut=true;
mm_menu_0109002736_2.bgColor='#999999';
window.mm_menu_0109002736_3 = new Menu("root",137,16,"Verdana, Arial, Helvetica, sans-serif",10,"#999999","#333333","#ffffff","#ffffff","left","middle",230,0,30000,-5,7,true,true,true,0,true,true);
mm_menu_0109002736_3.addMenuItem("world&nbsp;play&nbsp;day","window.open('wpd.htm', 'mainFrame');");
mm_menu_0109002736_3.addMenuItem("telegram&nbsp;from&nbsp;Italy","window.open('mfip.htm', 'mainFrame');");
<!--mm_menu_0109002736_3.bgImageUp="mmmenu1_137x16_up.gif";
<!--mm_menu_0109002736_3.bgImageOver="mmmenu1_137x16_over.gif";
mm_menu_0109002736_3.fontWeight="bold";
mm_menu_0109002736_3.hideOnMouseOut=true;
mm_menu_0109002736_3.bgColor='#999999';
window.mm_menu_0109002736_4 = new Menu("root",137,16,"Verdana, Arial, Helvetica, sans-serif",10,"#999999","#333333","#ffffff","#ffffff","left","middle",230,0,30000,-5,7,true,true,true,0,true,true);
mm_menu_0109002736_4.addMenuItem("link&nbsp;persons","window.open('lp.htm', 'mainFrame');");
mm_menu_0109002736_4.addMenuItem("worldwide&nbsp;toy&nbsp;libraries","window.open('wwtl.htm', 'mainFrame');");
<!--mm_menu_0109002736_4.bgImageUp="mmmenu1_137x16_up.gif";
<!--mm_menu_0109002736_4.bgImageOver="mmmenu1_137x16_over.gif";
mm_menu_0109002736_4.fontWeight="bold";
mm_menu_0109002736_4.hideOnMouseOut=true;
mm_menu_0109002736_4.bgColor='#999999';
mm_menu_0109002736_4.writeMenus();
} // mmLoadMenus()
//-->
</script>

from your top.htm is usually what is in a separate external 'config' file. Nothing wrong with having it on the page though, especially in a frames setup.

loh
09-16-2006, 08:29 AM
Hi...

Thanks for the explanation...I can understand how it works now.
But still having problems.....

I know I need to have new menu images so I've created those files.

In order to get an extra menu between "wpd" and "link", I used the code for "link" for "new menu" and added below codes in the HEAD session for "link". But this doesn't work.


window.mm_menu_0109002736_5 = new Menu("root",137,16,"Verdana, Arial, Helvetica, sans-serif",10,"#999999","#333333","#ffffff","#ffffff","left","middle",230,0,30000,-5,7,true,true,true,0,true,true);
mm_menu_0109002736_5.addMenuItem("link&nbsp;persons","window.open('lp.htm', 'mainFrame');");
mm_menu_0109002736_5.addMenuItem("worldwide&nbsp;toy&nbsp;libraries","window.open('wwtl.htm', 'mainFrame');");
<!--mm_menu_0109002736_5.bgImageUp="mmmenu1_137x16_up.gif";
<!--mm_menu_0109002736_5.bgImageOver="mmmenu1_137x16_over.gif";
mm_menu_0109002736_5.fontWeight="bold";
mm_menu_0109002736_5.hideOnMouseOut=true;
mm_menu_0109002736_5.bgColor='#999999';
mm_menu_0109002736_5.writeMenus();

So how can I make this work?

Loh