Voila le code d'une page pour une galerie photo. Et je voudrais activer les aperçu des photos miniatures par le survole de celle ci avec la souris. Pourriez vous m'aider ?
merci d'avance
<?php if (isset($_GET['image']))
{
$image = $_GET['image'];
$nomimage = preg_replace('`(.+)\..*`', '$1', $image);
}
?>
Code : Tout sélectionner
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Diaporama<?php if (isset($image)) {echo ' : '.$nomimage;}?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body
{background-color:#000000;}
h1, p.center
{text-align: center;
color: blue;}
a img
{padding: 1px;
border: 1px dotted gray;}
.liste_image
{width: 120px;
height: 67px;
float: left;
text-align: center;
font-size: 12px;}
</style>
</head>
<body>
<?php if (isset ($image))
{
echo ' <h1>'.$nomimage.'</h1>
<p class="center"><img src="photos/'.$image.'" alt="'.$nomimage.'" title="'.$nomimage.'" /></p>
';
}
$dir = 'photos/miniatures/*.{jpg,jpeg,gif,png}';
$files = glob($dir,GLOB_BRACE);
foreach($files as $image)
{
$image = preg_replace('`photos/miniatures/(.+)`','$1',$image);
$nomimage = preg_replace('`(.+)\..*`', '$1', $image);
echo ' <div class="liste_image"><a href="?image='.$image.'" onmouseover="?image='.$image.'"><img src="photos/miniatures/'.$image.'" alt="'.$nomimage.'" title="'.$nomimage.'" /></a><br />
'.$nomimage.'</div>
';
}
?>
Code : Tout sélectionner
</body>
</html>++ nico5715