', { src: src }).appendTo('#logotypes-container');*/ }); setInterval(function() { /*$('#logotypes-container').when(clearLogos()).then(shuffle());*/ /*$('#logotypes-container').shuffle();*/ /*$.when($('#logotypes-container').clearLogos()).then($('#logotypes-container').shuffle());*/ $('#logotypes-container').clearLogos(); $('#logotypes-container').promise().done(function(){ $('#logotypes-container').shuffle(); }); }, logosDisplayTime * 1000); }); (function ($) { $.fn.clearLogos = function () { var /*_self = this,*/ children = $.shuffle(this.children().get()); let logosCount = 0; $.each(children, function () { /*logosCount++;*/ var logo = $(this); /*_self.append(this);*/ /*$(this).fadeOut('slow');*/ /*setTimeout(function() {*/ logo.fadeOut('fast').remove(); /*}, logosCount * 100);*/ }); }; $.fn.shuffle = function () { let logosCount = 0; $.each($.shuffle(logosArr), function (_, src) { logosCount++; if(logosCount <= logosLimit){ /*setTimeout(function() {*/ var l = $('
'); l.appendTo('#logotypes-container').fadeIn('slow', 'linear'); /*}, logosCount * 200);*/ } }); return this; }; $.shuffle = function (arr) { for (var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); return arr; }; })(jQuery);