J'aimerais créer aa série de variables comme suit les paramètres qui ont par chacun:JS/jQuery - conseils sur la création d'une variable qui peut être utilisé dans de multiples fonctions
var panel_myfeed = new Array();
panel_myfeed[0]="/myfeed";
panel_myfeed[1]="#view-panel-myfeed";
panel_myfeed[2]="XXXXXXXX";
var panel_OtherPanel = new Array();
panel_OtherPanel[0]="/otherurl";
panel_OtherPanel[1]="#other-url-panel";
var panel_OtherPanel2 = new Array();
panel_OtherPanel2[0]="/otherurl2";
panel_OtherPanel2[1]=".other-url-panel2";
Alors je veux avoir deux fonctions séparées pouvant utiliser ces variables
function WhichPanel(url) {
*** Given a URL var like /myfeed, which which panel[0] this belongs to so I can get the other variables
** do something now that I have the settings above
}
function KillPanel(url) {
*** Given a URL var like /myfeed, which which panel[0] this belongs to so I can get the other variables
** do something now that I have the settings above
}
Suggestions? thxs
suggestions? – yoda