l li').first().hide('slow', function(){ $('#home-banner ul li').first().fadeOut('slow').remove(); }); return false; } function change_banner() { var element = $('#home-banner-nav li.active').next(); if (0==element.length) { element = $('#home-banner-nav li').first(); } var item = $(element).children('a'); banners(item); } var home_banner = setInterval(change_banner, 5000); change_banner(); });