If fadeCounternot declared in the global scope, this will not work. Make sure you specify the variable outside the handler document.ready(or delete it window.).
The function does call (only once, see the next paragraph), but you do not see the effect . After the first "cycle" all the elements are visible, so the second time the call fadeInhas no effect on them.
, fadeIn , : http://jsfiddle.net/fkling/nZ7Mn/
fadeNext, , , reset:
$(s).fadeIn(1000,fadeNext);
if (window.fadeCounter == 8) window.fadeCounter = 0;
#slide9, fadeIn , .
@Cybernate, . , . , .
, , . :
var max = 4;
function fadeNext(i) {
i = i % max;
$('body').append('<div>Current counter: ' + i + '</div>');
$('#s' + i).fadeIn(1000,function() {
$(this).fadeOut(1000, function(){fadeNext(i + 1)});
});
}
fadeNext(0);
, ( " ", ), .
DEMO
: ?