Michele Basso
a- a+

Immagine che si ingrandisce al passaggio del mouse

Con questo DHTML vedremo come è possibile cheun'immagine venga ingrandita quando ci passiamo sopra conil mouse. Un effetto molto bello soprattutto utilizzato condei bottoni.

VISUALIZZA L'ESEMPIO

Per utilizzare lo script, dobbiamo inserire questo codiceall'interno del tag head:

<script language="JavaScript1.2">function expand() {    if (smallslot.width<=110) {  x=window.setTimeout('expand()', 10)  smallslot.width=smallslot.width + 5  smallslot.height=smallslot.height + 5    }    else {  setTimeout('reduce()', 0)}    }function reduce() {    if (smallslot.width>99) {  x=window.setTimeout('reduce()', 10)  smallslot.width=smallslot.width - 13  smallslot.height=smallslot.height -13    }}</script>

Poi l'immagine va inserita utilizzando un codice comequesto:

<div id="slot1" style="width:99;height:128" onmouseover=expand()><a href="http://www.ducati.com" target="_top"><IMG id="smallslot" SRC="998s.jpg" width=69 height=52 border=0 style="position:absolute; left:296; top:104;z index:2;visibility:visible"></a></div>