'); 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 images2 = ["img/vietnam/04.jpg", "img/vietnam/06.jpg", "img/vietnam/07.jpg", "img/vietnam/08.jpg", "img/vietnam/11.jpg", "img/vietnam/14.jpg", "img/vietnam/18.jpg", "img/vietnam/19.jpg", "img/vietnam/27.jpg", ,"img/vietnam/31.jpg"]; $.each(images2, function(k, v) { image_temp = new Image(); image_temp.src = v; image_temp.onload = function () { $('#carousel-inner').append('
'); } }); var images3 = ["img/vietnam/03.jpg", "img/vietnam/12.jpg", "img/vietnam/16.jpg", "img/vietnam/30.jpg", "img/vietnam/26.jpg"]; $.each(images3, function(k, v) { image_temp = new Image(); image_temp.src = v; image_temp.onload = function () { $('#carousel-inner').append('
'); } }); });