I am having a bit of an issue with centering images within an image rotator. The rotator is a php/jquery rotator, its very simple. the issue I am having is getting the images to be absolute middle. I have tried what seems to be everything I know, but I am at a loss.
Here is the code to make the rotator work:
<?
// Global Variables
$image_dir = "$_SERVER[DOCUMENT_ROOT]/port/photo/"; // directory on server
$image_relative_path = '/port/photo/'; // path to images relative to script
$file_types = array('jpg','jpeg');
$image_time = '4000'; // seconds each image will display (4000 = 4 seconds)
if($handle = opendir($image_dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$ext_bits = explode(".",$file); // finds file extensions
foreach($ext_bits as $key => $value){
if(in_array($value,$file_types)){
$image_rotation .= '<li><div align="center"><img align="absmiddle" src="'.$image_relative_path.'/'.$file.'"></div></li>';
}
}
}
}
closedir($handle);
}
?>
<script>
$(document).ready(function() {
$('#image_rotate').innerfade({
speed: 'slow',
timeout: 4000,
type: 'random',
containerheight: '500px'
});
});
</script>
<div align="center">
<div class="rotator">
<ul id="image_rotate" style="list-style: none;">
<?= $image_rotation; ?>
</ul>
</div>
</div>
Now here is the CSS used:
.rotator {
width: 500px;
height:500px;
margin:auto 10px;
}
.rotator ul {
margin:auto;
padding:0;
}
rotator ul li {
margin:auto;
padding:0;
}
rotator ul li img {
vertical-align:middle;
margin:auto 0;
}
.rotator img {
max-height:500px;
max-width:500px;
margin:auto;
}
You can view what I have done here: http://jeffriesproductions.com/test
Any help would be great thanks everyone!