Monday, 9 September 2013

jquery loop function with fo()

jquery loop function with fo()

I pasted all the code. but I would like the loop for() was repeated to
infinity.
//PRELOADER
jQuery(window).load(function () { // makes sure the whole site is loaded
jQuery("#status").fadeOut(); // will first fade out the loading animation
jQuery("#preloader").delay(350).slideUp(500); // will fade out the
white DIV that covers the website.
//SET DELAY TO MODIFY THE DELAY OF THE INTRO ANIMATION
//INTRO ANIMATION
var delay = 1200;
var titleheight = $('#animate-container h1').outerHeight();
var count = $('#animate-container').height() / titleheight;
for (var i = 0; i < count; i++) {
var distance = titleheight * i;
$('#animate-container').delay(delay).animate({
'top': '-' + distance + 'px'
}, 400, 'easeOutBounce');
}
$('#animate-container').delay(delay).animate({
'top': '0px'
}, 500, 'easeOutBounce');
if ($(".home .cover i").length > 0 && $(window).width() > 767) {
$('.home .cover i').delay((count * delay) + (delay * 2)).animate({
'top': $('.cover i').offset().top - 180
}, 500, 'easeOutBounce', function () {
//$('.cover h3').fadeIn(500);
});
}
//END WINDOW ANIMATION
$(window).trigger('resize');
})
})(jQuery);

No comments:

Post a Comment