I have a div that displays a series of images in your background:
<div id="header-slider">
...
</div>
In order for the images to loop through I made the following code in JQuery:
var imagens =
[
'url(imagem01.jpg)',
'url(imagem02.jpg)',
'url(imagem03.jpg)',
'url(imagem04.jpg)',
'url(imagem05.jpg)',
],imgindex = 0, $header = $('#header-slider');
setInterval(function()
{
$header
.css('background-image', imagens[imgindex++ % imagens.length]);
}, 3000);
Now I need this transition to be smooth. There are several slider solutions that use img elements but I did not find any that manipulate the 'background-image' attribute. How can I do this?