par
TRUNCKS » 21 déc. 2011, 11:04
Bonjour à vous,
J'ai essayé de faire une petite galerie dynamique avec galleryview.
Cela fonctionne bien pour les images, mais j'aimerai pouvoir afficher le titre à droite de l'image en fonction de celle où l'on se trouve.
J'ai fait cela mais le titre reste figé sur la dernière image.
<?php
require_once('admin/connexion/localhost.php');
$conn = mysql_connect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_query("SET CHARACTER SET 'utf8';")or die(mysql_error());
mysql_select_db($database_localhost, $conn);
$sql_categorie = "SELECT * FROM bibliographie_articles";
$requete_categorie = mysql_query($sql_categorie) or die( mysql_error());
$sql_image = "SELECT * FROM images_bibliographie ORDER BY titre_image";
$requete_image = mysql_query($sql_image) or die( mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="galleryview/js/jquery.timers-1.2.js"></script>
<script type="text/javascript" src="galleryview/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="galleryview/js/jquery.galleryview-3.0-dev.js"></script>
<link type="text/css" rel="stylesheet" href="galleryview/css/jquery.galleryview-3.0-dev.css" />
<script>
$(function(){
$('#myGallery').galleryView({
panel_width: 600,
panel_height: 400,
frame_width: 55,
panel_scale: 'fit'
});
});
</script>
</head>
<body>
<div id="galerie" style="width:600px; position:relative; float:left; top:-30px; left:90px; font-family:'NewScript'; font-size: 14px; color:#999;">
<br />
<h1 id="titre" style="text-align:center; width:400px; margin-left:110px; font-size:14px;">Bibliographie</h1>
<?php while ($result_image = mysql_fetch_array($requete_image)){
$titre = $result_image['titre_image'];
$image = $result_image['url_image'];
$image_mini = $result_image['url_image_mini'];?>
<ul id="myGallery">
<li><img frame="images/bibliographie/<?php echo $image;?>" src="images/bibliographie/<?php echo $image;?>" />
</li>
<?php
}
?>
</ul>
</div>
<div id="text" style="font-size:12px; float:right;"><?php echo $titre;?></div>
</body>
</html>
Bonjour à vous,
J'ai essayé de faire une petite galerie dynamique avec galleryview.
Cela fonctionne bien pour les images, mais j'aimerai pouvoir afficher le titre à droite de l'image en fonction de celle où l'on se trouve.
J'ai fait cela mais le titre reste figé sur la dernière image.
[php]
<?php
require_once('admin/connexion/localhost.php');
$conn = mysql_connect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_query("SET CHARACTER SET 'utf8';")or die(mysql_error());
mysql_select_db($database_localhost, $conn);
$sql_categorie = "SELECT * FROM bibliographie_articles";
$requete_categorie = mysql_query($sql_categorie) or die( mysql_error());
$sql_image = "SELECT * FROM images_bibliographie ORDER BY titre_image";
$requete_image = mysql_query($sql_image) or die( mysql_error());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="galleryview/js/jquery.timers-1.2.js"></script>
<script type="text/javascript" src="galleryview/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="galleryview/js/jquery.galleryview-3.0-dev.js"></script>
<link type="text/css" rel="stylesheet" href="galleryview/css/jquery.galleryview-3.0-dev.css" />
<script>
$(function(){
$('#myGallery').galleryView({
panel_width: 600,
panel_height: 400,
frame_width: 55,
panel_scale: 'fit'
});
});
</script>
</head>
<body>
<div id="galerie" style="width:600px; position:relative; float:left; top:-30px; left:90px; font-family:'NewScript'; font-size: 14px; color:#999;">
<br />
<h1 id="titre" style="text-align:center; width:400px; margin-left:110px; font-size:14px;">Bibliographie</h1>
<?php while ($result_image = mysql_fetch_array($requete_image)){
$titre = $result_image['titre_image'];
$image = $result_image['url_image'];
$image_mini = $result_image['url_image_mini'];?>
<ul id="myGallery">
<li><img frame="images/bibliographie/<?php echo $image;?>" src="images/bibliographie/<?php echo $image;?>" />
</li>
<?php
}
?>
</ul>
</div>
<div id="text" style="font-size:12px; float:right;"><?php echo $titre;?></div>
</body>
</html>
[/php]