I have a code below that is doing animations on a random element between 1 and 6. But here it repeats one number x amounts of times.
How can I change this code to not repeat a random number?
x = 6;
$("#best_brands > .flow > img").each(function() {
var timer = Math.floor(Math.random() * 300) + 600
var number = 1 + Math.floor(Math.random() * x);
fadeBrands(timer, number);
});
function fadeBrands(timer, number) {
$('#best_brands > .flow > img:lt("'+number+'")').animate({
opacity: 1
}, timer);
}