Because of this, the background images of fadeInOut transitions produce a strange effect in the white texts of all texts. I decided to program my own image rotator with the fadeinout effect
var intervalo; var i= 0; var photos = [ "http://toniweb.us/gm/img/galeria/fondo1.jpg", "http://toniweb.us/gm/img/galeria/fondo2.jpg", "http://toniweb.us/gm/img/galeria/fondo3.jpg", "http://toniweb.us/gm/img/galeria/fondo4.jpg" ]; function rotarFondo(){ var container = $('#headerimgs'); var current = container.children('div:visible:first'); var imgSrc = photos[i]; i++; if(i == photos.length) i = 0; console.log(imgSrc); var next = (current.next().length > 1) ? current.next() : container.children('div:visible'); current.css('background',imgSrc); next.css('background',imgSrc); current.fadeOut(300); next.fadeIn(300); } function congelarFondo(){ } $(document).ready(function(){ if (intervalo ) clearInterval(intervalo ); intervalo = setInterval('rotarFondo()',1000); });
interval value and image calculation work fine, but I donβt know why bgImgaes are not actually applied,
Testing here now http://jsfiddle.net/bE9Dq/27/
any idea?
source share