I have the function that changes the opacity of several elements with class .single-product
to 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 the elements have a small fade when the page loads. How to make a shorter 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);
});
}
}