2
I have the function that changes the opacity of various elements with the class .single-product
for 1
. My problem is that whenever the page loads, this function will run an animation for 500 milliseconds and after that it performs the same function again so that all elements have a small fade when the page loads. How to make a minor delay between these animations?
var children = [];
$("#prod-general").children().each(function() {
children.push(this);
});
function fadeThemOut(children) {
if (children.length > 0) {
var currentChild = children.shift();
$(currentChild).set.animate({
'opacity': '1'},
500, function() {
fadeThemOut(children);
});
}
}
Resolution of the problem solved at: http://stackoverflow.com/questions/25611168/run-callback-function-in-the-middle-of-an-animation-instead-of-the-end?noredirect=1#comment40009048_25611168
– Caio Kawasaki
Hi, Caio, welcome to [en.so]. You can publish your own answer, so we have the problem solution record here too.
– brasofilo