﻿$(document).ready(function() {
    setTimeout(function() {
        shift();
    }, 5000);
});

function shift() {
    $('.anim-content .item').each(function(index) {
        if($(this).position().top < 20) {
            $(this).animate({top: '-=30'}, 1000, function() { 
                $(this).css({top: 12 + 30 * $(this).siblings().length});
                setTimeout(function() {
                    shift();
                }, 5000);
            }); 
        } else {
            $(this).animate({top: '-=30'}, 1000);
        }
    });
}

