I have a problem when I want to change the background image with a fadeOut / In. The problem is that it makes an Out / In of all content (div and form child). What I need is that it only affects the image of the parent div (.valign-wrapper). Some help? Thank you!
<div class="valign-wrapper">
<div class="div2">
<div class="div3">
<form>
</form>
</div>
</div>
</div>
$(function () {
var i = 0;
var images = ['Background1.jpg', 'Background2.jpg', 'Background3.jpg'];
var image = $('.valign-wrapper');
setInterval(function () {
image.fadeOut(1000, function () {
image.css('background-image', 'url(/Images/' + images[i] + ')');
image.fadeIn(1000);
});
if (i === (images.length - 1)) {
i = 0;
} else {
i++;
}
}, 5000);
})