Как сделать плавную смену картинок фона?
Есть вот такой скрипт, но там смена происходит не плавно
var imgHead = [
'img/header_bg1.jpg',
'img/header_bg2.jpg',
'img/header_bg3.jpg',
], i=1;
function csaHead(){
if(i > (imgHead.length-1)){
$('.content').animate({'opacity':'0'},200,function(){
i=1;
$('.content').css({'background':'url('+imgHead[0]+')'});
});
$('.content').animate({'opacity':'1'},200);
}else{
$('.content').animate({'opacity':'0'},200,function(){
$('.content').css({'background':'url('+imgHead[i]+')'});
i++;
});
$('.content').animate({'opacity':'1'},200);
}
}
var intervalCsaHead = setInterval(csaHead,8000);