Ciao a tutti, ho implementato un semplice box con delle miniature d' immagini, al passaggio del mouse lo sfondo cambia dinamicamente, tutto bene, l' unica cosa è che se assegno come sfondo iniziale un' immagine invece che un colore, non modifica più lo sfondo.
Segue lo script
<div id="cambiasfondo">
[img]background/ssfondo1.png[/img]
[img]background/ssfondo2.png[/img]
[img]background/ssfondo3.png[/img]
[img]background/ssfondo4.png[/img]
[img]background/ssfondo5.png[/img]
[img]background/ssfondo6.png[/img]
[img]background/ssfondo7.png[/img]
[img]background/ssfondo8.png[/img]
[img]background/ssfondo9.png[/img]
</div>
<script type="text/javascript">
var backImage = new Array();
backImage[0] = "background/sfondo1.png";
backImage[1] = "background/sfondo2.png";
backImage[2] = "background/sfondo3.png";
backImage[3] = "background/sfondo4.png";
backImage[4] = "background/sfondo5.png";
backImage[5] = "background/sfondo6.png";
backImage[6] = "background/sfondo7.png";
backImage[7] = "background/sfondo8.png";
backImage[8] = "background/sfondo9.png";
backImage[9] = "";
function changeBGImage(whichImage)
{
if (document.body)
{
document.body.background = backImage[whichImage];
}
}
</script>
Mi chiedo sinceramente il perchè??