Can this be modified to size the image proportional insted of set width and height.
The PHP file that goes with the above isHTML Code:<style type="text/css"> .slideshow{ /*CSS for DIV containing each image*/ float: left; margin-left: 5px; margin-right: 5px; margin-bottom: 16px; } .slideshow img{ /*CSS for each image tag*/ border: 0; width: 173px; height: 127px; } #navlinks{ /*CSS for DIV containing the navigational links*/ width: 200px; } #navlinks a{ /*CSS for each navigational link*/ margin-right: 8px; margin-bottom: 3px; font-size: 100%; } #navlinks a.current{ /*CSS for currently selected navigational link*/ background-color: yellow; } </style>
PHP Code:<?
Header("content-type: application/x-javascript");
function returnimages($dirname=".") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
$filedate=date ("M d, Y", filemtime($file));
echo 'galleryarray[' . $curimage .']=["' . $file . '", "'.$filedate.'"];' . "\n";
$curimage++;
}
}
closedir($handle);
}
return($files);
}
echo "var galleryarray=new Array();" . "\n";
returnimages();
?>



Reply With Quote


Bookmarks