<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Vakantie-foto's!</title>
<style type="text/css">
body
{
background:#fff;
}
img
{
width:auto;
box-shadow:0px 0px 20px #cecece;
-moz-transform: scale(0.7);
-moz-transition-duration: 0.6s;
-webkit-transition-duration: 0.6s;
-webkit-transform: scale(0.7);
-ms-transform: scale(0.7);
-ms-transition-duration: 0.6s;
}
img:hover
{
box-shadow: 20px 20px 20px #dcdcdc;
-moz-transform: scale(0.8);
-moz-transition-duration: 0.6s;
-webkit-transition-duration: 0.6s;
-webkit-transform: scale(0.8);
-ms-transform: scale(0.8);
-ms-transition-duration: 0.6s;
}
</style>
</head>
<body>
<?php
$folder_path = 'vakantie-album/'; //image's folder path
$num_files = glob($folder_path . "*.{JPG,jpg,gif,png,bmp}", GLOB_BRACE);
$folder = opendir($folder_path);
if($num_files > 0)
{
while(false !== ($file = readdir($folder)))
{
$file_path = $folder_path.$file;
$extension = strtolower(pathinfo($file ,PATHINFO_EXTENSION));
if($extension=='jpg' || $extension =='png' || $extension == 'gif' || $extension == 'bmp')
{
?>
<!-- <a href="<?php echo $file_path; ?>"><img src="<?php echo $file_path; ?>" height="250" /></a> -->
<a href="#" onClick="myWindow(<?php echo $file_path; ?>); return false;"><img src="<?php echo $file_path; ?>" height="200"></a>
<?php
}
}
}
else
{
echo "Dit vakantie-album is nog leeg!";
}
closedir($folder);
?>
<!-- script om venster te openen -->
<script type="text/javascript">
function myWindow(i,t,wid,hei) {
var day= new Date();
var id = day.getTime();
//Full screen
var w = (window.width);
var h = (window.height);
/*
You can also use the original image height and width as
var w = wid+100;
var h = hei+100;
*/
var params = 'width='+(w-50)+',height='+(h-50)+',scrollbars,resizable';
var message='<html><head><title>'+i+'</title></head><body><h3 aligh="center">'+
'<div align="center"><img src="'+i+'" border="0" alt="'+t+'"><br>\
'+
'<hr width="100%" size="1"><form><input type="button" onclick="javascript:window.close();" value="Close Window"><br>\
'+
'<hr width="100%" size="1"></form></div></body></html>\
';
var mywin = open('',id,params);
mywin.document.write(msg);
mywin.document.close();
}
</script>
</body>
</html>
[size=xsmall]Toevoeging op 21/05/2017 19:29:40:[/size]
Jan te Pas op 21/05/2017 19:23:42
<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Vakantie-foto's!</title> <style type="text/css"> body { background:#fff; } img { width:auto; box-shadow:0px 0px 20px #cecece; -moz-transform: scale(0.7); -moz-transition-duration: 0.6s; -webkit-transition-duration: 0.6s; -webkit-transform: scale(0.7); -ms-transform: scale(0.7); -ms-transition-duration: 0.6s; } img:hover { box-shadow: 20px 20px 20px #dcdcdc; -moz-transform: scale(0.8); -moz-transition-duration: 0.6s; -webkit-transition-duration: 0.6s; -webkit-transform: scale(0.8); -ms-transform: scale(0.8); -ms-transition-duration: 0.6s; } </style> </head> <body> <?php $folder_path = 'vakantie-album/'; //image's folder path $num_files = glob($folder_path . "*.{JPG,jpg,gif,png,bmp}", GLOB_BRACE); $folder = opendir($folder_path); if($num_files > 0) { while(false !== ($file = readdir($folder))) { $file_path = $folder_path.$file; $extension = strtolower(pathinfo($file ,PATHINFO_EXTENSION)); if($extension=='jpg' || $extension =='png' || $extension == 'gif' || $extension == 'bmp') { ?> <!-- was en toont afbeelding in venster: <a href="<?php echo $file_path; ?>"><img src="<?php echo $file_path; ?>" height="250" /></a> --> <!-- nu javascript aanroepen en pop-up met afbeelding tonen --> <a href="#" onClick="myWindow(<?php echo $file_path; ?>); return false;"><img src="<?php echo $file_path; ?>" height="200"></a> <?php } } } else { echo "Dit vakantie-album is nog leeg!"; } closedir($folder); ?> <!-- script om venster te openen --> <script type="text/javascript"> function myWindow(i,t,wid,hei) { var day= new Date(); var id = day.getTime(); //Full screen var w = (window.width); var h = (window.height); /* You can also use the original image height and width as var w = wid+100; var h = hei+100; */ var params = 'width='+(w-50)+',height='+(h-50)+',scrollbars,resizable'; var message='<html><head><title>'+i+'</title></head><body><h3 aligh="center">'+ '<div align="center"><img src="'+i+'" border="0" alt="'+t+'"><br>\ '+ '<hr width="100%" size="1"><form><input type="button" onclick="javascript:window.close();" value="Close Window"><br>\ '+ '<hr width="100%" size="1"></form></div></body></html>\ '; var mywin = open('',id,params); mywin.document.write(msg); mywin.document.close(); } </script> </body> </html>