http://www.grupporiva.it/prova.html
grazie
per capire se funziona ho fatto
codice:
//ALLONTANAMENTO
function allontana(livello){
document.getElementById(livello).style.opacity=1;
n_liv=parseInt(livello.substring(5));
sx=parseInt(document.getElementById(livello).style.left);
sx_1=parseInt(document.getElementById("Layer"+(n_liv+1)).style.left);
if((sx_1-sx)==100){
for (i=n_liv+1; i<6; i++) {
sx=parseInt(document.getElementById("Layer"+i).style.left);
document.getElementById("Layer"+i).style.left=sx+250+"px";
document.getElementById("Layer"+i).style.opacity=0.8;
}
zindex=0;
for (i=2; i<6; i++) {
zindex_1=parseInt(document.getElementById("Layer"+i).style.zIndex);
if (zindex<zindex_1){
zindex=parseInt(document.getElementById("Layer"+i).style.zIndex);
}
//***********************
alert("ciao");
//***********************
}
}
document.getElementById(livello).style.zIndex=zindex+1;
}
e il messaggio non appare
EDIT:
ho provato anche a mettere solo l'alert dopo il primo for e non fa nemmeno quello =\
sn abbastanza nuovo con javascript (è il mio primo programmino) quindi magari c'è qualcosa che mi sfugge
codice:
//ALLONTANAMENTO
function allontana(livello){
document.getElementById(livello).style.opacity=1;
n_liv=parseInt(livello.substring(5));
sx=parseInt(document.getElementById(livello).style.left);
sx_1=parseInt(document.getElementById("Layer"+(n_liv+1)).style.left);
if((sx_1-sx)==100){
for (i=n_liv+1; i<6; i++) {
sx=parseInt(document.getElementById("Layer"+i).style.left);
document.getElementById("Layer"+i).style.left=sx+250+"px";
document.getElementById("Layer"+i).style.opacity=0.8;
}
//***********************
alert("ciao");
//***********************
}
//document.getElementById(livello).style.zIndex=zindex+1;
}