jquery .addClass() .fadeIn() in IE7
Hey guys, ive noticed a problem with my jquery script. It is really laggy and slow in IE7, and fadeIn() is not fading. It is bugging me alot, since the
http://api.jquery.com/fadeIn/ works fine in ie7.
My script is:
$(document).ready(function() {
// Global.Variables
$slideShow = $('.slideshow');
$slideShowSlide = $slideShow.find('.slide');
$slideShowControl = $slideShow.find('.controls li.bread');
var e;
// index.slides and preload.images
for (var i = 0; i < $slideShowSlide.length; i++) {
$slideShowControl.eq(i).attr('alt',i);
var picture = $slideShowSlide.eq(i).css('background-image').replace(/url\(\"/i, "").replace(/\"\)/i, "");
$slideShow.append('<img src="'+picture+'" class="imagePreloader" style="width:1px;height:1px;" />');
}
// Slide baby, slide!
function ssShow(to) {
if (to >= $slideShowSlide.length){to = 0;}
$slideShowSlide.stop(true, true);
$slideShow.find('.slide.active').fadeOut().removeClass('active');
$('.controls li.bread').removeClass('active');
$slideShowSlide.eq(to).fadeIn().addClass('active');
$slideShowControl.eq(to).addClass('active');
refreshTimeout();
}
function refreshTimeout() {
clearTimeout(e);
e = setTimeout(function() {
var localIndex = $('.controls li.bread.active').attr('alt');
localIndex++;
ssShow(localIndex);
}, 7000);
}
function stopTimeout() {
clearTimeout(e);
}
// Run the show
$slideShowControl.click(function() {
var localIndex = $(this).attr('alt');
ssShow(localIndex);
return false;
});
ssShow(0);
refreshTimeout();
// playback
$slideShow.find('a.pause').live('click',function() {
stopTimeout();
$(this).removeClass('pause').addClass('play');
return false;
});
$slideShow.find('a.play').live('click',function() {
$(this).addClass('pause').removeClass('play');
refreshTimeout();
return false;
});
});
Any one have any ideas, as to why it works like this? There is a live version here
http://access.charnley.dk/slideshow/ so you can see how buggy it is in IE7.
Thanks in advanced.
/Jimmy