i'm Mirko and this is my first topic.
I'm a beginner in PHP.
I'm doing some exercises and i write this code in order to view some images in rows and i put in the javascript function onmouseover and onmouseout in order to pass through the image and zoom in the image.
Code: Select all
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function zoom (chi, quanto) {
chi.style.width = quanto +"px";
chi.style.height = quanto +"px";
}
</script>
<style>
td {border: 1px solid red;}
img {height: 100px; width:100px;}
</style>
<title>My</title>
</head>
<body>
<?php
$elencoJPG = glob("*.jpg");
echo "<table>";
for ($miniatura = 0; $miniatura < count($elencoJPG); ) {
echo "<tr>";
for ($suQuestaRiga = 0; $suQuestaRiga < 4 && $miniatura < count($elencoJPG); $miniatura++, $suQuestaRiga++) {
echo "<td> <img id='$miniatura' src='$elencoJPG[$miniatura]'
onmouseover ='zoom(this; 200);'
onmouseout ='zoom(this; 100);' /> </td>";
}
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>