'); numImagesLoaded++; if(numImagesLoaded == 4) { $('#status').fadeOut(); // will first fade out the loading animation $('#preloader').delay(350).fadeOut('slow', function(){ $( "#carousel-example-generic" ).attr('data-ride', "carousel"); $( ".item" ).first().addClass( "active" ); }); // will fade out the white DIV that covers the website. $('body').delay(350).css({'overflow':'visible'}); $('.carousel').carousel({ pause: "false", interval: 10000 }); $('.carousel').css({'margin': 0, 'width': $(window).outerWidth(), 'height': $(window).outerHeight()}); $(window).on('resize', function() { $('.carousel').css({'width': $(window).outerWidth(), 'height': $(window).outerHeight()}); }); } } }); var images4 = ["img/balkans/2.jpg", "img/balkans/6.jpg"]; $.each(images4, function(k, v) { image_temp = new Image(); image_temp.src = v; image_temp.onload = function () { $('#carousel-inner').append('
'); numImagesLoaded++; } }); });