Php5.1

Fermé
dyk_dark Messages postés 8 Date d'inscription samedi 9 juin 2007 Statut Membre Dernière intervention 24 septembre 2011 - 7 sept. 2009 à 19:21
Atropa Messages postés 1940 Date d'inscription mercredi 25 juin 2008 Statut Membre Dernière intervention 11 mai 2014 - 8 sept. 2009 à 02:13
Bonjour,
je debute dans l'apprentissage de php5.1 et suis confronté a un problème de comptage.En realite j'ai deux images (photo 1 et photo 2) j'aimerais creer un script pour mon site web personel grace auquel la photo 1 se transformera en photo 2 au bout de 5 seconde et vice versa.Merci pour votre aide

1 réponse

Atropa Messages postés 1940 Date d'inscription mercredi 25 juin 2008 Statut Membre Dernière intervention 11 mai 2014 274
8 sept. 2009 à 02:13
tu ne peux pas faire ca en php c'est du javascript qu'il te faut!

fonction simple :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
	<title>IMAGE</title>
	
	<style type="text/css">

	</style>
	<script type="text/javascript">
	<!--
		function inverseImg(idImg,pathImg2) {
			var img = document.getElementById(idImg);
			var pathImg = img.src;
			var inter = function () {
				img.src = (img.src == pathImg) ? pathImg2 : pathImg;
			}
			setInterval(inter,5000);
		}
	
	
	//-->
	</script>
	</head>
	<body>
	<div>
	<img id="image1" src="monImage" alt="image" />
	<script type="text/javascript">
	<!--
		inverseImg('image1','./monImage2.jpg');
	//-->
	</script>
	</div>
	</body>
</html>
0