$(document).ready(function(){ var first = 0; var speed = 200; var pause = 8500; var speed1 = 200; var pause1 = 8500; (function($) { $.fn.customFadeIn = function(speed, callback) { $(this).fadeIn(speed, function() { if(!$.support.opacity) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.customFadeOut = function(speed, callback) { $(this).fadeOut(speed, function() { if(!$.support.opacity) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.customFadeTo = function(speed,to,callback) { return this.animate({opacity: to}, speed, function() { if (to == 1 && jQuery.browser.msie) this.style.removeAttribute('filter'); if (jQuery.isFunction(callback)) callback(); }); }; })(jQuery); function removeFirst(){ first = $('ul#listticker li:first').html(); $('ul#listticker li:first') .animate({opacity: 0}, speed) .fadeOut('slow', function() {$(this).remove(); $('ul#listticker li:first') .animate({opacity: 1}, speed) .customFadeIn('slow'); addLast(first);}); } function addLast(first){ last = ''; $('ul#listticker').append(last) } function removeSecond(){ first1 = $('ul#listticker1 li:first').html(); $('ul#listticker1 li:first').wait1() .animate({opacity: 0}, speed1) .fadeOut('slow', function() {$(this).remove(); $('ul#listticker1 li:first') .animate({opacity: 1}, speed1) .customFadeIn('slow'); addLastSecond(first1);}); } function addLastSecond(first1){ last = ''; $('ul#listticker1').append(last) } interval = setInterval(removeFirst, pause); interval = setInterval(removeSecond, pause1); $.fn.wait = function(time, type) { time = time || 2000; type = type || "fx"; return this.queue(type, function() { var self = this; setTimeout(function() { $(self).dequeue(); }, time); }); }; $.fn.wait1 = function(time, type) { time = time || 4000; type = type || "fx"; return this.queue(type, function() { var self = this; setTimeout(function() { $(self).dequeue(); }, time); }); }; function runIt() { $("#poutac").wait().animate({marginTop: "+=213px"} ); $("#akce1").wait1().fadeIn("fast"); }; runIt(); });