Is there a general issue with JQuery or something more specific that is preventing this from working properly in IE? This Fiddle is a fork.
http://jsfiddle.net/AndyMP/bYrdk/
var images = [
"http://imaging.nikon.com/lineup/dslr/d90/img/sample/pic_003t.jpg",
"http://imaging.nikon.com/lineup/dslr/d90/img/sample/pic_005t.jpg",
"http://imaging.nikon.com/lineup/dslr/d90/img/sample/pic_001t.jpg"
];
var delay = 2000;
var transition = 1000;
for(var i in images)
{
var img = document.createElement("img");
img.src = images[i];
img.onload = function(){
var parent = document.getElementById("content");
parent.insertBefore(this,parent.childNodes[0]);
if(i == images.length - 1)
{
i = 0;
startSlides();
}
}
}
function startSlides()
{
$("#content img:last").delay(delay).fadeTo(transition,0,function(){
$(this).insertBefore($(this).siblings(":first")).fadeTo(0,1);
startSlides();
});
}
The div is empty, so it doesn’t have any childNodes and the argument
parent.childNodes[0]provided to insertBefore() causes an error, becauseinsertBefore()expects a node(and get’s an ‘undefined’)Insert at least a
into the div or use jQuery: