function DC() {
var elements = $(".panel");
elements.first().fadeOut(1000, function() {
$(this).insertAfter(elements.last());
$(this).fadeIn(1000);
});
}
$(document).ready(function() {
var i =0;
for (var i=0; i < 10; i++) {
DC();
};
});
I want DC() to loop 10 times, but it only looped once.
What did I do wrong?
for(var i = 0; i < 10; i++)should be enough to create your var i. To try find out if your loop really looped once, add an alert or so to check :)