I am changing my background image from this code
jQuery(window).load(function(){
var images = ['blaa.jpg','sdsd.jpg'];
var i = 0;
setInterval(function(){
jQuery('#absolute-c').css('background-image', function() {
if (i >= images.length) {
i=0;
}
return 'url(' + images[i++] + ')';
});
}, 3000);
})
how do .animate and load first background without delay. due to setInterval my first background also show after 3 sec
You can do create a function for this and use it in the setInterval:
Another solution, and I think is much better, is to use
setTimeoutinstead: