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:13

Pb of variable with opening module


Poster: davidarnoult
Dated: Monday February 27 2006 - 14:56:53 GMT

Hello,

I am using licenced version of menu. I use a javascript value to display the path of the menu, and the Automatic Menu Opening Module openmenusbyurl.js bolt on plugin. This almost works, except that when you enter in a submenu, and click on the parent menu, my path on vertical column is not updated. Something wrong with my function mm_getSelectionSequence() and _ocURL().

Can anyone help me on that ?

Thanks

David

Web link : http://fr.topsolid.com

Here is my menu_data.js :

Code:
<script language="JavaScript">
<!--
_menuCloseDelay=5000           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=0            // The time delay before menus open on mouse over
_subOffsetTop=0              // Sub menu top offset
_subOffsetLeft=0            // Sub menu left offset


/* All of the following paramater are none mandatory*/
//mm_maxLevels=0;         // parameter [INTEGER] to fix the number of menus displayed to the specified maximum value.
resetAutoOpen=true      // parameter This bit allows the menu to re-open if sibling menus have been closed, displaying the menu again if required.
//mm_contentFrame="Content"; // parameter - Currently in Beta so of no use in this version.
//forceChildSubOpen=true  // Forces the opening of a child sub menu if the opening items URL matches the current page URL and also opens a sub menu

function _ocURL(){
   if(_W.forceChildSubOpen){
      _cln=_cip.length
      for(_c=0;_c<_cln;_c++){
         if(_mi[_cip[_c]][3]){
            _mn=getMenuByName(_mi[_cip[_c]][3])
            _cip[_cip.length]=_m[_mn][0][0]
         }
      }
      forceChildSubOpen=0
   }
   

   _ombcu=new Array()   
   if(_cip.length>0){
      for(_c=0;_c<_cip.length;_c++){
         _ci=_cip[_c];
         _mni=getParentItemByItem(_ci);
         if(_mni==-1)_mni=_ci         
         if(_mni+" "!=$u){
            while(_mni!=-1){
               
               _ombcu[_ombcu.length]=_mni
               _mni=getParentItemByItem(_mni);
               if(_mni+" "==$u)_mni=-1               
            }
         }
      }
   }
   
   if(_startM){
      setTimeout("_ocURL()", 300)
   }
   else{
      
         if(_W.mm_contentFrame){
            //_hrF=parent.frames[mm_contentFrame].location.pathname+parent.frames[mm_contentFrame].location.search
            //_Lhr=parent.frames[mm_contentFrame].location.href
            //_hx=_Lhr.split("/")
            //_fNm="/"+_hx[_hx.length-1]
         }
      
      if(_ombcu.length&&(_W.mm_maxLevels>0||_W.mm_maxLevels+" "==$u)){
         for(_oma=_ombcu.length-1;_oma>-1;_oma--){
            _i=_ombcu[_oma]
            _I=_mi[_i]
            //alert(_I)
            
            _popi(_i)


            clickAction(_i)
            _ofMT=1

            if(_I[32]){
               _tI=gmobj("img"+_i)
               if(_tI&&_I[29])_tI.src=_I[29]
            }

            
            if(_oma==_W.mm_maxLevels)return
         }
      }
   }
}




// mm_separator is the separator string to be placed between
// menu item names in the output to the page.  Edit this
// to suit your taste.

var mm_separator = "<tr><td class='separator'></td></tr>";


// mm_selectionSequenc is the sequence of selected menu items
// that led to the last selected item.  Rebuilt when the page
// loads by the getSelectionSequenc() function

var mm_selectionSequence = "";


// mm_openUrl() is called to go to the next page.  It automatically
// passes the _itemRef (last active menu item) to the next page

function mm_openUrl(url)
{
   if (_itemRef == null){
   _itemRef = '<%=Session("menu")%>';
   }
   
  url+="?menu="+_itemRef;
  window.location.href = url;
}


// mm_getSelectionSequence extracts the _itemRef from the parameter
// passed in the url, then figures out the sequence of menu items
// that led to it.  Called at the bottom of this file so that it
// runs automatically when the page loads and after the menus are
// drawn


function mm_getSelectionSequence(){

  var urls = location.search;
 
  if (urls.lastIndexOf("menu=") >= 0 ) {
     var param=urls.substring(urls.lastIndexOf("menu="));
     var selectedItem = param.substring(5,param.length);
   
     var i = selectedItem;
  }
  else {
   var i = '<%=Session("menu")%>';
  }

if (_mi[i] != null ) {
  do {
   
   var url = _mi[i][2].substring(23,_mi[i][2].length - 2);
   
    if (mm_selectionSequence == "")
   
   mm_selectionSequence = '<tr><td class="slidemenu">&nbsp;<a title="' + _mi[i][1] + '" href="' + url + '?menu=' + i + '" onMouseOver="javascript:window.status=\'' + _mi[i][1] + '\';return(true);" onMouseOut="javascript:window.status=\'\';return(true);">' + _mi[i][1] + '</a></td></tr>' +mm_selectionSequence ;
    else
    mm_selectionSequence = '<tr><td class="slidemenu">&nbsp;<a title="' + _mi[i][1] + '" href="' + url + '?menu=' + i + '" onMouseOver="javascript:window.status=\'' + _mi[i][1] + '\';return(true);" onMouseOut="javascript:window.status=\'\';return(true);">' + _mi[i][1] + '</a></td></tr>'  + mm_separator + mm_selectionSequence;
   
   
   //mm_selectionSequence = '<tr><td class="slidemenu">&nbsp;<a href="' + url + '?menu=' + i + '" onMouseOver="javascript:window.status=\'Test\';return(true);" onMouseOut="javascript:window.status=\'\';return(true);">' + _mi[i][1] + '</a></td></tr>' +mm_selectionSequence ;
    //else
    //mm_selectionSequence = '<tr><td class="slidemenu">&nbsp;<a href="' + url + '?menu=' + i + '" onMouseOver="javascript:window.status=\'Test2\';return(true);" onMouseOut="javascript:window.status=\'\';return(true);">' + _mi[i][1] + '</a></td></tr>'  + mm_separator + mm_selectionSequence;
   
   
   
    i = getParentItemByItem(i);
   
  } while (!isNaN(i));
}
}

function elem(url,title) {
   this.url = url;
   this.title = title;
}

var Menu = new Array();
Menu[0] = new elem("/products/",'Produits');
Menu[1] = new elem("/services/",'Services');
Menu[2] = new elem("/download/",'Téléchargements');
Menu[3] = new elem("/successes/",'Succès Client');
Menu[4] = new elem("/news/",'Nouveautés');
Menu[5] = new elem("/vars/",'Réseau de Vente');
Menu[6] = new elem("/partners/",'Partenaires');
Menu[7] = new elem("/company/",'Société');


// Menu PRODUCTS
var SubMenu0 = new Array();
SubMenu0[0] = new elem("/products/plm/",'CFAO/ERP intégrée');
SubMenu0[1] = new elem("/products/industry/",'Solutions Métiers');
SubMenu0[2] = new elem("/products/2006/",'TopSolid 2006');

// Menu SERVICES
var SubMenu1 = new Array();
SubMenu1[0] = new elem("/services/support/",'Support');
SubMenu1[1] = new elem("/services/education/",'Education');
SubMenu1[2] = new elem("/services/training/",'Formation');
SubMenu1[3] = new elem("/services/msservices/",'Missler Software Services');

// Menu DOWNLOAD
var SubMenu2 = new Array();
SubMenu2[0] = new elem("/download/patch/",'Patches');
SubMenu2[1] = new elem("/download/free/","Logiciels Gratuits");
SubMenu2[2] = new elem("/download/marketing.asp","Marketing");
SubMenu2[3] = new elem("/download/videos.asp","Vidéos");


// Menu SUCCESSES
var SubMenu3 = new Array();
SubMenu3[0] = new elem("/successes/",'Reportages');

// Menu NEWS & EVENTS
var SubMenu4 = new Array();
SubMenu4[0] = new elem("/news/press/",'Communiqués de Presse');
SubMenu4[1] = new elem("/news/pressroom.asp",'Espace Presse');
SubMenu4[2] = new elem("/news/shows/",'Salons');
SubMenu4[3] = new elem("/news/newsletter/",'Newsletter');

// Menu RESEAU VENTE
var SubMenu5 = new Array();
SubMenu5[0] = new elem("/vars/frenchnetwork.asp",'France');
SubMenu5[1] = new elem("/vars/search",'International');

// Menu COMPANY
var SubMenu7 = new Array();
SubMenu7[0] = new elem("/company/profile.asp",'Présentation');
SubMenu7[1] = new elem("/company/careers.asp",'Recrutement');
SubMenu7[2] = new elem("/company/history.asp",'Historique');
SubMenu7[3] = new elem("/company/contactus/",'Contactez-nous');


with(menuStyle=new mm_style()){
onbgcolor="#006699";
align='center';
//onbgcolor="#4F8EB6";
oncolor="#ffffff";
//offbgcolor="#DCE9F0";
offbgcolor="#000000";
//offcolor="#515151";
offcolor="#ffffff";
bordercolor="#000000";
borderstyle="solid";
borderwidth=0;
separatorcolor="#CCCCCC";
separatorsize="1";
padding=3;
fontsize="10";
fontstyle="normal";
fontfamily="Arial";
pagecolor="white";
pagebgcolor="#006699";
headercolor="#000000";
headerbgcolor="#ffffff";
//subimage="menu/arrow.gif";
subimagepadding="0";
//overfilter='Fade(duration=0.2);Shadow(color='#777777',Direction=135,Strength=3)';
overfilter="fade(duration=0.5)";
outfilter="fade(duration=0.5)";
itemheight=20;
itemwidth=90;
//keepalive=1;
//separatorpadding=10;

}

with(SubMenuStyle=new mm_style()){
onbgcolor="#006699";
align='center';
//onbgcolor="#4F8EB6";
oncolor="#000000";
//offbgcolor="#DCE9F0";
offbgcolor="#006699";
//offcolor="#515151";
offcolor="#ffffff";
bordercolor="#000000";
borderstyle="solid";
borderwidth=0;
separatorcolor="#CCCCCC";
//separatorcolor="#2D729D";
separatorsize="1";
padding=3;
fontsize="10";
fontstyle="normal";
fontfamily="Arial";
pagecolor="black";
pagebgcolor="#006699";
headercolor="#000000";
headerbgcolor="#ffffff";
overfilter="fade(duration=0.5)";
outfilter="fade(duration=0.5)";
itemheight=20;
separatorpadding=10;
}

with(milonic=new menuname("Main Menu")){
style=menuStyle;
left=5;
top=85;
orientation="horizontal";
alwaysvisible=1;

for (var i = 0; i < Menu.length; i++){
   aI("text=" + Menu[i].title + ";url=javascript:mm_openUrl('" + Menu[i].url + "');showmenu=" + Menu[i].title + ";pagematch=" + Menu[i].url + ";status=" + Menu[i].title + ";");

}
}

with(milonic=new menuname(Menu[0].title)){
   style=SubMenuStyle;
   orientation="horizontal";
   left=5;
   //alwaysvisible=1;
   //itemwidth=130;

for (var i = 0; i < SubMenu0.length; i++){
      aI("text=" + SubMenu0[i].title + ";url=javascript:mm_openUrl('" + SubMenu0[i].url + "');showmenu=" + SubMenu0[i].title + ";pagematch=" + SubMenu0[i].url + ";status=" + SubMenu0[i].title + ";title=" + SubMenu0[i].title + ";");

}
}
with(milonic=new menuname(Menu[1].title)){
   style=SubMenuStyle;
   //itemwidth=80;
   left=5;
   orientation="horizontal";
   //alwaysvisible=1;
for (var i = 0; i < SubMenu1.length; i++){
      aI("text=" + SubMenu1[i].title + ";url=javascript:mm_openUrl('" + SubMenu1[i].url + "');showmenu=" + SubMenu1[i].title + ";pagematch=" + SubMenu1[i].url + ";status=" + SubMenu1[i].title + ";title=" + SubMenu1[i].title + ";");
}
}

with(milonic=new menuname(Menu[2].title)){
   style=SubMenuStyle;
   //itemwidth=100;
   left=100;
   orientation="horizontal";
   //alwaysvisible=1;
for (var i = 0; i < SubMenu2.length; i++){
      aI("text=" + SubMenu2[i].title + ";url=javascript:mm_openUrl('" + SubMenu2[i].url + "');showmenu=" + SubMenu2[i].title + ";pagematch=" + SubMenu2[i].url + ";status=" + SubMenu2[i].title + ";title=" + SubMenu2[i].title + ";");
}
}

with(milonic=new menuname(Menu[3].title)){
   style=SubMenuStyle;
   //itemwidth=80;
   left=315;
   orientation="horizontal";
   //alwaysvisible=1;

for (var i = 0; i < SubMenu3.length; i++){
      aI("text=" + SubMenu3[i].title + ";url=javascript:mm_openUrl('" + SubMenu3[i].url + "');showmenu=" + SubMenu3[i].title + ";pagematch=" + SubMenu3[i].url + ";status=" + SubMenu3[i].title + ";title=" + SubMenu3[i].title + ";");
}
}

with(milonic=new menuname(Menu[4].title)){
   style=SubMenuStyle;
   //itemwidth=120;
   left=320;
   orientation="horizontal";
   //alwaysvisible=1;

for (var i = 0; i < SubMenu4.length; i++){
      aI("text=" + SubMenu4[i].title + ";url=javascript:mm_openUrl('" + SubMenu4[i].url + "');showmenu=" + SubMenu4[i].title + ";pagematch=" + SubMenu4[i].url + ";status=" + SubMenu4[i].title + ";title=" + SubMenu4[i].title + ";");
}
}

with(milonic=new menuname(Menu[5].title)){
   style=SubMenuStyle;
   left=485;
   orientation="horizontal";
   //alwaysvisible=1;

for (var i = 0; i < SubMenu5.length; i++){
      aI("text=" + SubMenu5[i].title + ";url=javascript:mm_openUrl('" + SubMenu5[i].url + "');showmenu=" + SubMenu5[i].title + ";pagematch=" + SubMenu5[i].url + ";status=" + SubMenu5[i].title + ";title=" + SubMenu5[i].title + ";");
}
}



with(milonic=new menuname(Menu[7].title)){
   style=SubMenuStyle;
   //itemwidth=80;
   left=440;
   orientation="horizontal";
   //alwaysvisible=1;

for (var i = 0; i < SubMenu7.length; i++){
      aI("text=" + SubMenu7[i].title + ";url=javascript:mm_openUrl('" + SubMenu7[i].url + "');showmenu=" + SubMenu7[i].title + ";pagematch=" + SubMenu7[i].url + ";status=" + SubMenu7[i].title + ";title=" + SubMenu7[i].title + ";");
}
}




drawMenus();

mm_getSelectionSequence();

_ocURL()

//-->
</script>


Poster: Andy
Dated: Monday February 27 2006 - 18:13:52 GMT

Hi,

What exactly is not being updated?

Looking at the site it seems to be functioning correctly.

Regards,
Andy


Poster: Migru
Dated: Monday February 27 2006 - 20:21:44 GMT

Hi

you are using version 5.733, the actual version is 5.743 (todays release).

Michael

Detail of my problem


Poster: davidarnoult
Dated: Tuesday February 28 2006 - 5:51:14 GMT

Hello again,

I explain better : vertical menu does not work in this case :
An example : click using horizontal menu on Services, Education item. Vertical menu is OK.
Click now on Service item on horizontal menu, vertical menu is still on last value menu=12, should be menu=1... If you click again on Services, it works.
Something wrong with both functions. Can you help me to investigate?

Thanks for your help


David

PS : I will update it to the last version but I am sure this won't solve my problem.


Poster: Ruth
Dated: Tuesday February 28 2006 - 12:19:37 GMT

Hi,

I get a page with this as the end of the url
Code:
services/education/?menu=12
the horizontal submenu for Services is open, and the vertical menu has Services, Education, a blank area and then rechercher search box below.

Then I click Service in the Horizontal menu again and I get
Code:
services/?menu=1
and the vertical menu has Services, a blank line and Rechercher below it.

This is IE5.5. I get the same thing in FF

Ruth

Something wrong...


Poster: davidarnoult
Dated: Tuesday February 28 2006 - 15:30:26 GMT

I am terribly sorry but I reproduce systematically the problem.
I use IE 6 and FF 1.0.7 and it always happens on both browsers.

Could you try again, maybe it's a buffer problem.

URL is http://fr.topsolid.com or http://www.topsolid.fr

Using Horiz menu, Open Produits, Then TopSolid 2006, then Produits again, I get ?menu=8 instead of 0, and vertical menu is therefore wrong.

Could you try again on http://www.topsolid.com I have same problem there.

Thanks for help

David

PS : I have not updated yet to last menu version, do you think it might solve that problem ?


Poster: Migru
Dated: Tuesday February 28 2006 - 15:53:26 GMT

Hi

yes, this is to confirm exactly what happended, menu=8 as you´ve reported.

Michael


Poster: Ruth
Dated: Tuesday February 28 2006 - 23:16:55 GMT

Hi,

OK, I got it to do that a couple of times. This is not something I know much about, however, I noticed that when you mouseover Produits and down into the submenu the mouse pointer never changes, almost as if there is no 'off' state from the Produits menu to the submenu. After reproducing it a couple of times, I began trying to place my mouse up as far into Produits as I could and then it quit having the problem. Just as a test, to see if this might be contributing to it, can you set the offset for the submenu farther down and see if the problem still occurs when you do the Produits, then TopSolid and then Produits again?

Ruth


Poster: davidarnoult
Dated: Wednesday March 1 2006 - 8:38:35 GMT

Hi, I tried to offset down the sub menu but it's still the same. I think there is something to do with the openbymenu function, because if I don't use it, it works !

Could you contact the person who develops this bolt on module, and submit him the problem ?

Thanks

David


Poster: Migru
Dated: Wednesday March 1 2006 - 10:38:56 GMT

Hi

as you have a license, why don´t you make use of the support pls. see

http://www.milonic.com/support/

and there you could refer to forum url and this viewtopic id.

http://www.milonic.com/forum/viewtopic.php?t=7203


Michael


Poster: Ruth
Dated: Wednesday March 1 2006 - 15:55:27 GMT

Hi,

Michael's right on that if nothing else is fixing the problem. Thanks Michael for all the help you are providing on the forum. It is really appreciated :)

:oops: I don't know where my head is, but the subOffsetTop will not offset a submenu from a horizontal main menu. I forgot about that so no matter your setting that wouldn't work. If you want to test what I suggested you'll need to use top="offset=x"; where x is the number of pixels to offset the submenu. That needs to be put in the submenu. The only reason I suggest testing it is to narrow the possibilities of what might be causing the problem.

Ruth


Poster: Migru
Dated: Wednesday March 1 2006 - 16:14:05 GMT

Hi Ruth

do you have a portable, on the road via satellite?
Or is the PC the last what will be packed?

Actually, if I had the time........would like to go through all that code, in order to spot the bug, where something like a counter is not properly reset, when, after a click the menu has been selected. (That is my suspicion, of course can´t prove, because I really don´t know yet anything of that algorithm controlled by functions and selecting the corresponding vertical menus)

Michael


Poster: davidarnoult
Dated: Thursday March 2 2006 - 11:28:31 GMT

Thanks Guys for your efforts anyway, I will mail the support to see what they can do.

Rgds

David