Fade in/out carousel

$(document).ready(function(){
		function fade(){
			$div = $('.item');
			$first = $('.item:first-child');
			$last = $('.item:last-child');

			

				if($first.is(':visible')){
					$first.hide();

					$next = $first.next();
					$next.fadeIn();
				}
				else if($last.is(':visible')){ $last.hide(); $first.fadeIn();}
				else{
					$next.hide();

					$next = $next.next();
					$next.fadeIn();
				}


			setTimeout( function(){fade();} , 5000);
		}

		setTimeout( function(){fade();} , 5000);
	})

max

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>