Michele Basso
a- a+

Immagine con effetto onda cliccando su un bottone

Con questo DHTML è possibile avere un effetto onda suun'immagine, dopo la pressione di un bottone.

VISUALIZZA L'ESEMPIO

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

<SCRIPT LANGUAGE="JavaScript">var filterStrings = new Array();var count = 0;var wavable = 1;var wavphase = 0;var interval = 225;var lightinterval = 100;var lightcount = 0;var maxStuff = 10;var light;var spread = 0;var position = 0;var chainable = 1;function animatwav(){    if(wavable){  wavphase = (wavphase + 10) % 100;  if(theImg..filter == "wave(freq=4, strength=8, phase=0, lightstrength=25, add=1, enabled=1)"){theImg.filters[0].phase = wavphase;  }  window.setTimeout("animatwav()" , 0400, "JavaScript");    }}</SCRIPT>

Poi l'immagine va inserita utilizzando un codice comequesto:

<div id=theImg style="WIDTH:90%; font-size:18pt;font-family:verdana;font-style:bold" ><IMG id=glbimg hspace=10 vspace=10 width=250 height=189 src="998s_mono.jpg"></div>

E il bottone va inserito con un codice come questo:

<input class=clsbtn value="Clicca per provare" type=button name=animwave onclick="theImg.style.filter = 'wave(freq=4, strength=8, phase=0, lightstrength=25, add=1, enabled=1)'; wavable = 1; animatwav();">