Dynamically change clickfunction property of an item

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
benfel
Beginner
Beginner
Posts: 2
Joined: Wed May 11, 2005 3:39 pm

Dynamically change clickfunction property of an item

Post by benfel »

Hi all,

I try to use the following function to dynamically change the clickfunction property of an item :

Code: Select all

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 :

Code: Select all

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 :

Code: Select all

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.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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?

Ruth
benfel
Beginner
Beginner
Posts: 2
Joined: Wed May 11, 2005 3:39 pm

Post by benfel »

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

Benfel
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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

Kevin
Post Reply