I have the rotatePics jquery script in my webpage:
$(document).ready(function(){
rotatePics(1);
});
function rotatePics(currentPhoto) {
var numberOfPhotos = $('.photos img').length;
currentPhoto = currentPhoto % numberOfPhotos;
$('.photos img').eq(currentPhoto).fadeOut(function() {
// re-order the z-index
$('.photos img').each(function(i) {
$(this).css(
'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
);
});
$(this).show();
setTimeout(function() {rotatePics(++currentPhoto);}, 5000);
});
}
I have the following in my header section of the homepage:
<script type="text/javascript" src="js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
Here is the HTML in the homepage:
<div id="imageanimation">
<table id="picturetable">
<tr>
<td class="photos"></td>
<td class="photos"></td>
<td class="photos"></td>
<td class="photos"></td>
</tr>
</table>
</div> <!-- close imageanimation div -->
<!-- Your website would not let me upload images -->
Here is the CSS:
#picturetable {
float:left;
height:212px;
margin:0 auto;
position:relative;
left:15px;
z-index:-1;
}
.photos img {
position: absolute;
}
.photos {
width: 212px;;
height: 212px;
overflow: hidden;
padding:5px;
padding-top:10px;
padding-bottom:10px;
}
What am I doing wrong?