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

Dynamically change clickfunction property of an item

Poster: benfel
Dated: Wednesday May 11 2005 - 15:55:17 BST

Hi all,

I try to use the following function to dynamically change the clickfunction property of an item :
function mm_changeItemProperty(menuName, itemName, codeRef, newValue, updateDisplay)
  menuName = menuName.toLowerCase();
  for (i=0; i<_mi.length; i++)
    if (_mi[i][1].replace(/\&nbsp\;/ig,' ') == itemName && _m[_mi[i][0]][1] == menuName) break;
  if (i == _mi.length) return;
  _mi[i][codeRef] = newValue;
  if (updateDisplay) BDMenu(_mi[i][0]);

This is my personnal code :
mm_changeItemProperty('Period','de 1995 à 1999',62,"selectPeriod('9599','1995-99')",0);
mm_changeItemProperty('Period','de 1990 à 1994',62,"selectPeriod('9599','1995-99')",0);
mm_changeItemProperty('Period','de 2000 à 2004 (incomplète)',62,"selectPeriod('9599','1995-99')",0);
mm_changeItemProperty('Period','de 1990 à 2000',62,"selectPeriod('9599','1995-99')",0);

My problem is that when I executed this code, the selectPeriod function is not processed.

This code perfectly works :
mm_changeItemProperty('Period','de 1995 à 1999',8,'#515151',0);
mm_changeItemProperty('Period','de 1990 à 1994',8,'#515151',0);
mm_changeItemProperty('Period','de 2000 à 2004',8,'#515151',0);
mm_changeItemProperty('Period','de 1990 à 2000',8,'#515151',0);

Could anyone help me, please.

Thanks by advance.

Poster: Ruth
Dated: Wednesday May 11 2005 - 21:09:50 BST

Hi benfel,

I think it will have to be Kevin who helps you with this. He is the person here who understands functions.

So we have complete information, are you trying to set this up so that under certain conditions when you click the item your function is implemented and under other conditions it isn't implemented? Or are you trying to just have a function that takes place all the time when you click a particular item?


Poster: benfel
Dated: Thursday May 12 2005 - 8:35:53 BST

Hi Ruth,

I found the solution of my problem. It came from my code.
The function mm_changeItemProperty works very well, indeed.

Sorry to have disturbded you


Poster: kevin3442
Dated: Tuesday May 17 2005 - 1:39:11 BST

Just curious... was it a problem with quotes?