Devo sommare l'altezza di N DIV, e ho creato una funzione javascript. Senza ciclo FOR tutto funziona, se invece uso il FOR e commento il codice in eccesso, non mi somma nulla.
Codice:
function somma (box_other)
{
h_box_down = 0;
tot = 0;
var i;
for (i=0; !(isNaN(h_box_down)); i++)
{
/*i = 0;*/
h_box_down = parseInt(window.getComputedStyle(box_other[i], null).getPropertyValue("height"));
if (!(isNaN(h_box_down)))
tot += h_box_down;
/*i = 1;
h_box_down = parseInt(window.getComputedStyle(box_other[i], null).getPropertyValue("height"));
if (!(isNaN(h_box_down)))
tot += h_box_down;*/
}
document.write("<br>Totale = " + tot);
}