So I have put together a jquery image rotator just to fade in and out a set of images on a page. (note, may not be relevant but it is a drupal site).
This works in all but the IE's. I have been trying to figure out why this is for so long and I cannot find it. Any help would be much appreciated. Here is the HTML:
The CSS:
#billboard-blocks .views-field-field-banner-img-fid img {
float:right;
position:absolute;
}
.views-field-field-banner-img-fid div {
position:absolute;
z-index:100;
}
.views-field-field-banner-img-fid div.previous {
z-index:101;
}
.views-field-field-banner-img-fid div.current {
z-index:102;
}
And finally, the jQuery:
$(document).ready(function() {
$('.views-field-field-banner-img-fid .field-item-0').addClass('current');
setInterval("rotateImages()", 5000);
});
function rotateImages() {
var oCurPhoto = $(".views-field-field-banner-img-fid .field-item.current");
var oNxtPhoto = oCurPhoto.next();
if(oNxtPhoto.length == 0) {
oNxtPhoto = $(".views-field-field-banner-img-fid div.field-item:first");
}
oCurPhoto.removeClass('current').addClass('previous');
oNxtPhoto.css({ opacity: 0.0 }).addClass('current').animate({ opacity: 1.0 }, 1000,
function() {
oCurPhoto.removeClass('previous');
});
}