Ciao ho scaricato una funzione per la creazione di ToolTip Dinamici.
In una prima parte vengono dichiarati degli array di valori in questo modo :
Dopo nell' evento mouseOver di un link, passo questa funzione :codice:Text[0]=["Cosnet Faq.","Click to View/Hide the Answer."] //Admin Text[1]=["Admin Section.","Click Here to open Admin Section."] //Address Text[2]=["Address Section.","Click Here to open Address Application."]
Dove Text è l' array passato per il testo e Style per lo stile.codice:onmouseover="stm(Text[8],Style[9]);"
Questa è la funzione stm :
Come posso passare io i valori dell' array Text al posto di dover creare 10mila array di tooltip già pronti??codice:function stm(t,s) { if(sNav) { if(t.length<2||s.length<25) { var ErrorNotice = "DHTML TIP MESSAGE VERSION 1.2 ERROR NOTICE.\n" if(t.length<2&&s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array and Text Array of this tip.\nTheir should be 25 entries in every Style Array even though empty and 2 in every Text Array. You defined only "+s.length+" entries in the Style Array and "+t.length+" entry in the Text Array. This tip won't be viewed to avoid errors") else if(t.length<2) alert(ErrorNotice+"It looks like you removed an entry or more from the Text Array of this tip.\nTheir should be 2 entries in every Text Array. You defined only "+t.length+" entry. This tip won't be viewed to avoid errors.") else if(s.length<25) alert(ErrorNotice+"It looks like you removed an entry or more from the Style Array of this tip.\nTheir should be 25 entries in every Style Array even though empty. You defined only "+s.length+" entries. This tip won't be viewed to avoid errors.") } else { var ab = "" ;var ap = "" var titCol = (s[0])? "COLOR='"+s[0]+"'" : "" var txtCol = (s[1])? "COLOR='"+s[1]+"'" : "" var titBgCol = (s[2])? "BGCOLOR='"+s[2]+"'" : "" ... ... ...
Es:
Premetto che cosi' mi da errore ...codice:onmouseover="stm(Text["Titolo","Testo"],Style[9]);"


Rispondi quotando