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 :
Code:
function mm_changeItemProperty(menuName, itemName, codeRef, newValue, updateDisplay)
{
menuName = menuName.toLowerCase();
for (i=0; i<_mi.length; i++)
if (_mi[i][1].replace(/\ \;/ig,' ') == itemName && _m[_mi[i][0]][1] == menuName) break;
if (i == _mi.length) return;
_mi[i][codeRef] = newValue;
if (updateDisplay) BDMenu(_mi[i][0]);
}
{
menuName = menuName.toLowerCase();
for (i=0; i<_mi.length; i++)
if (_mi[i][1].replace(/\ \;/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:
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);
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:
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);
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?
Ruth