Je cherche de laide en javascript svpl

pihkawi Messages postés 15 Date d'inscription   Statut Membre Dernière intervention   -  
avion-f16 Messages postés 19252 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,

dans une partie de mon site je cherche a présenter les hôtels en images , je cherche a créer ce script ( voila un exemple de script que je cherche : https://www.splendia.com/fr/marrakech-hotels.html ) mais le problème je n'arrive pas a mettre ce scripte dynamique .

merci d'avance pour votre aide

1 réponse

avion-f16 Messages postés 19252 Date d'inscription   Statut Contributeur Dernière intervention   4 507
 
Javascript :
function changerImage(url) {
	document.getElementById("imagebig").src = url;
	return false;
}
CSS :
.imagetiny {
	width:120px;
}
HTML :
<img src="image1.png" alt="" id="imagebig" />
<br/>
<img src="image1.png" alt="" class="imagetiny" onclick="changerImage(this.src);" />
<img src="image2.png" alt="" class="imagetiny" onclick="changerImage(this.src);" />
<img src="image3.png" alt="" class="imagetiny" onclick="changerImage(this.src);" />
1