$(document).ready(function(){ var first = 0; var speed = 200; var pause = 5500; function removeFirst(){ first = $('ul#listticker li:first').html(); $('ul#listticker li:first') .animate({opacity: 0}, speed) .fadeOut('slow', function() {$(this).remove(); addLast(first); $('ul#listticker li:first').animate({opacity: 1}, speed).fadeIn('slow'); }); } function addLast(first){ last = ''; $('ul#listticker').append(last) } interval = setInterval(removeFirst, pause); $.fn.wait = function(time, type) { time = time || 100; type = type || "fx"; return this.queue(type, function() { var self = this; setTimeout(function() { $(self).dequeue(); }, time); }); }; function runIt(){ $("").wait().animate({marginTop: "-=80px"}, function() {$(".obsah").wait().slideDown("slow");}); } runIt(); });