• Regolamento Macrocategoria DEV
    Prima di aprire un topic nella Macrocategoria DEV, è bene leggerne il suo regolamento. Sei un'azienda o un hosting/provider? Qui sono anche contenute informazioni per collaborare con Sciax2 ed ottenere l'accredito nella nostra community!

JavaScript Collegamento ipertestuale per singola immagine!

caivano

Nuovo utente
Autore del topic
30 Luglio 2016
1
0
Miglior risposta
0
[FONT=&quot]Salve a tutti. Come dice il titolo, sto cercando di inserire un collegamento ipertestuale per singola immagine in uno script che mi estrae a sorte un immagine.[/FONT]
[FONT=&quot]Eccovi il codice in questione![/FONT]


[FONT=&quot]<script language="Javascript">[/FONT]
[FONT=&quot]<!--[/FONT]
[FONT=&quot]function image() {[/FONT]
[FONT=&quot]};[/FONT]
[FONT=&quot]image = new image();[/FONT]
[FONT=&quot]number = 0;[/FONT]
[FONT=&quot]// imageArray[/FONT]
[FONT=&quot]image[number++] = "<b><center>SORTEGGIO5</center></b> <center><img src='img/3.png'></center>"[/FONT]
[FONT=&quot]image[number++] = "<b><center>SORTEGGIO4</center></b> <center><img src='img/2.png'></center>"[/FONT]
[FONT=&quot]image[number++] = "<b><center>SORTEGGIO3</center></b> <center><img src='img/1.png'></center>"[/FONT]
[FONT=&quot]increment = Math.floor(Math.random() * number);[/FONT]
[FONT=&quot]//-->[/FONT]
[FONT=&quot]</script>[/FONT]
[FONT=&quot]COME POSSO INSERIRE UN COLLEGAMENTO IPERTESTUALE PER SINGOLA IMMAGINE? CIOE IN UNA DI QUELLE IMMAGINI ESTRATTE VORREI FARE IN MODO CHE SI CI POSSA CLICCARE SOPRA! MA QUANDO METTO UN <a href="sorteggio.html"> LO SCRIPT NON FUNZIONA PIU!![/FONT]