Riporto alcune modifiche fatte alle funzioni javascript, ma l'animazione non funziona ancora.
Codice PHP:
var div = null;
var msec = 300;
var id = 0;
function init(menu) {
div = document.getElementById(menu); //DIV da animare
div.style.visibility = "visible";
var topString = document.getElementById('marker_link');
div.style.marginTop = topString.offsetHeight + 20 +'px'; // 20 è l'altezza del menu
div.style.marginLeft = topString.offsetLeft;
animate(); //Chiamata alla funzione che anima il div
}
function animate() {
if(div.offsetHeight < 10){
//div.style.height = parseInt(div.style.)+1+"px";
alert("ggg");
div.style.height = div.offsetHeight+1+'px';
id = setTimeout(animate,msec);//Ripete lo spostamento per tot millisecondi
}
}