up. nessuno che mi sappia aiutare?
in alternativa mi basterebbe un'altra soluzione...
quello che ho fatto io è questo:
codice:
var SSito = "Il sito del Gruppo di Minoranza del Comune di Filago";
function ChiamataTit() {
CreaStatus();
}
function CreaStatus() {
var arrSSito = SSito.split(" ");
var Tempo = 40;
var pattern = new RegExp("[^ ]")
var strStatus = SSito.replace(pattern, "/");
window.status = "";
InserStatus(arrSSito, Tempo, strStatus);
}
function InserStatus(arrSSito, Tempo, strStatus) {
var arrT = strStatus.split(" ")
for (i = 0; i < arrSSito.length; i++) {
var strParola = arrSSito[i];
var numRand = Math.round(Math.random() * (strParola.length - 1));
var strCar = strParola.charAt(numRand);
var strParoT = arrT[i];
var strCarT = strParoT.charAt(numRand);
for (y = 0; y < strParoT.length; y++) {
if (y == numRand) {
var char = strParoT.charAt(y);
if (char == "/") {
char = strCar;
}
}
}
}
strStatus = arrT.join(" ");
window.status = strStatus;
var ToW = window.setTimeout(function() {InserStatus(arrSSito, Tempo, strStatus);}, Tempo);
if (window.Status == SSito) {
window.clearTimeout(ToW);
}
}
all'onLoad della pagine viene richiamata la function ChiamataTit che fà altre cose oltre a modificare lo status...
ora dovrei sostituire char in strParoT alla posizione y...
non sò ne se va bene, ne se è performante o se c'è qualche altra soluzione...
poi un'altra cosa: ho notato che numRand specialmente nella prima parola non è mai =0, perchè?
grazie