Ciao a tutti
Ho preso lo script sotto elencato e sto cercando di renderlo dinamico:in pratica ho una pagina di amministrazione dove inserisco 2 immagini una grande e una piccola.
Ho scaricato questo scrpt che serve a fare lo zoom dell'immagine piccola richiamando la grande a tutto schermo.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it">
<head>
<title>>Un plugin jQuery per l'effetto zoom con smooth - Esempio JavaScript scaricato da HTML.it</title>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="it" />
<meta name="Robots" content="All" />
<meta name="Description" content="HTML.it - il sito italiano sul Web publishing" />
<meta name="Keywords" content="javascript" />
<meta name="Owner" content="HTML.it srl" />
<meta name="Author" content="HTML.it srl" />
<meta name="Copyright" content="HTML.it srl" />
<link rel="stylesheet" type="text/css" href="css/imgzoom.css" />
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" media="screen"
href="/css/msie/ie6.css" />
<noscript>
<link rel="stylesheet" type="text/css" media="screen"
href="/css/msie/ie6-nojs.css" />
</noscript>
<script type="text/javascript" src="/js/DD_belatedPNG_0.0.8a.js"></script>
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" media="screen" href="/css/msie/ie7.css" />
<![endif]-->
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery.imgzoom.pack.js"></script>
<script type="text/javascript">
$(function () {
$('#img1').imgZoom({ showOverlay: true });
$('#img2').imgZoom({ showOverlay: true, opacity: 0 });
$('#img3').imgZoom({ showOverlay: true, rotate: true, duration: 1000 });
});
</script>
</head>
<body>
<h1>Un plugin jQuery per l'effetto zoom con smooth</h1>
<div class="container demo">
<div style="float: left; width: 50%;">
<table>
<tbody>
<tr>
<td>
[img]flower1s.jpg[/img]
Zoom
</td>
<td>
[img]flower2s.jpg[/img]
Zoom with fade in
</td>
<td>
[img]flower3s.jpg[/img]
Zoom with rotation
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div align="center">
[img]logo_htmlit.gif[/img]
</body>
</html>
Ho modificato il codice in questo modo:
<?php do { ?>
<script type="text/javascript" src="scripts/jquery.min.js"></script>
<script type="text/javascript" src="scripts/jquery.imgzoom.pack.js"></script>
<script type="text/javascript">
$(function () {
$('#img1').imgZoom({ showOverlay: true });
$('#img2').imgZoom({ showOverlay: true, opacity: 0 });
$('#img3').imgZoom({ showOverlay: true, rotate: true, duration: 1000 });
});
</script>
</head>
<body>
<div class="container demo">
<div style="float: left; width: 50%;">
<table>
<tbody>
<tr>
<td>
[img]<?php echo $dirname2.($row_allestimenti['foto2']); ?>[/img]" />
<?php echo $row_allestimenti['descrizione']; ?>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php } while ($row_allestimenti = mysql_fetch_assoc($allestimenti)); ?>
</tr>
<tr>
<td colspan="2" align="left">[img]image/piede.png[/img]</td>
</tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($allestimenti);
?>
Non ho postato la parte di collegamento al database.
Risultato mi appaiono tutte le immagini che sono contenute nella tabella del database ma fa lo zoom solo della prima.
Grazie mille