Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:02

Collapsible Menu Problems


Poster: KeithA
Dated: Monday June 26 2006 - 20:22:48 BST

Brand new to Milonic products. Downloaded the collapsing menu system today. Currently working off localhost on my system to see if this is what I want to use. Copied appropriate files to the root area of the localhost site, and made the name change in the pasted code at the top of my body code. Since I wanted to embed the menu in a table, I cut that code from the collapse_data.js file and pasted in between the <td> </td> where I wanted it to be. The menu appears fine in both IE and NS; but none of the submenus will expand when the parent is clicked. Running Windows XP and testing with IE 5+ and NS7

Actual code here if you need it to help me out.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
   font-family: Verdana, Arial, Helvetica, sans-serif;
}
body {
   margin-left: 0px;
   margin-top: 0px;
   margin-right: 0px;
   margin-bottom: 0px;
}
a:link {
   text-decoration: none;
}
a:visited {
   text-decoration: none;
}
a:hover {
   text-decoration: underline;
}
a:active {
   text-decoration: none;
}
.style1 {color: #FFFF00}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<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="collapse_data.js" type=text/javascript></SCRIPT>
</head>

<body onLoad="MM_preloadImages('navimages/home_1.gif')">
<table width="100%"  border="0" cellspacing="0" cellpadding="0"><!--DWLayoutTable-->
  <tr>
    <td width="546" height="81" valign="top"><img src="images/banner_name_r1_c1.gif" width="546" height="81"></td>
    <td width="100%" height="70" background="images/banner_plain.gif" bgcolor="#FFFFFF"></td>
    <td><img src="images/banner_SEE.gif" width="89" height="81"></td>
  </tr>
  <tr>
    <td height="18" colspan="3"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','navimages/home_1.gif',1)"><img src="navimages/home.gif" alt="Home page" name="Image7" width="82" height="30" border="0"></a></td>
  </tr><tr><td height="1"><img src="images/spacer.gif" alt="" width="546" height="1"></td>
    <td></td>
    <td><img src="images/spacer.gif" alt="" width="91" height="1"></td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><!--DWLayoutTable-->
  <tr>
    <td bgcolor="#FFFFDF">&nbsp;</td>
    <td width="100%" rowspan="3" bgcolor="#FFFFFF">
  <tr>
    <td valign="top" bgcolor="#FFFFDF"><img src="images/worship_times.gif" width="140" height="140"></td>
  </tr>
  <tr>
    <td valign="top" bgcolor="#FFFFDF">
   <script type="text/javascript">
   
with(new menuname("main Tree Menu")){
top=15
left=10
style = tstyle1;
alwaysvisible = 1;
position = "relative";
itemwidth=200
//margin=AllMargin
//position="relative"
aI("text=MILONIC;");
aI("text=Home;");
aI("text=News;showmenu=News;type=tree;image=blue_blip.gif;overimage=red_blip.gif");
aI("text=Finance;showmenu=Finance;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Sports;showmenu=Sports;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Entertainment;showmenu=Entertainment;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Music;showmenu=Music;type=tree;image=blue_blip.gif;overimage=red_blip.gif;");
aI("text=Games;");
aI("text=Relationships;");
aI("text=Travel;");
aI("text=Shopping;");
}

   with(new menuname("News")){
   style = sub1Style;
   margin=AllMargin
   aI("text=National;url=#");
   aI("text=International;url=#");
   aI("text=Technology;url=#");
   aI("text=Politics;url=#");
   aI("text=Campaign 2004;url=#");
   aI("text=Health & Wellness;url=#");
   }


   with(new menuname("Finance")){
   style = sub1Style;
   margin=AllMargin
   aI("text=MILONIC;url=#");
   aI("text=US Markets;showmenu=US Markets;type=tree;image=lblue_blip.gif;overimage=red_blip.gif;");
   aI("text=Portfolio;url=#");
   aI("text=Watch list;url=#");
   aI("text=Price Alert;url=#");
   aI("text=Sectors;url=#");
   aI("text=Advanced Chart;url=#");
   }

      with(new menuname("US Markets")){
      style = sub2Style;
      margin=AllMargin
      aI("text=Market Snapshot;url=#");
      aI("text=Market Movers;url=#");
      aI("text=Word on The Street;url=word.php");
      aI("text=Gainers/Losers;url=#");
      aI("text=Most Actives;url=#");
      aI("text=News;url=#");
      }

   with(new menuname("Sports")){
   style = sub1Style;
   margin=AllMargin
   aI("text=MLB;url=#");
   aI("text=NBA;url=#");
   aI("text=NFL;url=#");
   aI("text=NHL;url=#");
   aI("text=College Sports;url=#");
   aI("text=Golf;url=#");
}

   with(new menuname("Entertainment")){
   style = sub1Style;
   margin=AllMargin
   aI("text=Frssh;url=#");
   aI("text=Cable TV Showcase;url=cable.php");
   aI("text=Movie Trailers;url=#");
   }

   with(new menuname("Music")){
   style = sub1Style;
   margin=AllMargin
   aI("text=Broadband Music;url=#");

   }

drawMenus()
   </script>
   
<!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr><tr><td height="1"><img src="images/spacer.gif" alt="" width="140" height="1"></td><td></td></tr>
</table>
</body>
</html>


Poster: Ruth
Dated: Tuesday June 27 2006 - 3:21:39 BST

Hi,

You forgot the treemenu.js file that is needed to let the menu function as a tree type menu.

You can find that under the bolt-on Modules from the main site.

Go to the Dhtml Menu, mouseover and then look toward the bottom for Bolt-on Modules, click and then the treemenu.js module is about in the middle of the page.

Ruth

Collapsible Menu Problem


Poster: KeithA
Dated: Tuesday June 27 2006 - 4:19:03 BST

Thanks, I actually had the js file; but had not placed the src ref in the <script tag>. Thanks anyway, you got me up and running with the reply. :P