crear un slide infinito HTML+CSS+ JQUERY


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {
       $('#carousel_ul li:first').before($('#carousel_ul li:last'));
       $('#right_scroll').click(function(){
           var item_width = $('#carousel_ul li').outerWidth() + 10;
           var left_indent = parseInt($('#carousel_ul').css('left')) - item_width;
           $('#carousel_ul:not(:animated)').animate({'left' : left_indent},500,function(){  
               $('#carousel_ul li:last').after($('#carousel_ul li:first'));
               $('#carousel_ul').css({'left' : '0'});
           });
       });
       $('#left_scroll').click(function(){
           var item_width = $('#carousel_ul li').outerWidth() + 10; //704
           var left_indent = parseInt($('#carousel_ul').css('left')) + item_width;
           $('#carousel_ul:not(:animated)').animate({'left' : left_indent},500,function(){  
           $('#carousel_ul li:first').before($('#carousel_ul li:last'));
           $('#carousel_ul').css({'left' : '0'});
           });
       });
 });
</script>
<style type="text/css">

#carousel_inner {
float:left; /* important for inline positioning */
width:630px; /* important (this width = width of list item(including margin) * items shown */
overflow: hidden;  /* important (hide the items outside the div) */
/* non-important styling bellow */
background: #F0F0F0;
}

#carousel_ul {
position:relative;
left:-210px; /* important (this should be negative number of list items width(including margin) */
list-style-type: none; /* removing the default styling for unordered list items */
margin: 0px;
padding: 0px;
width:9999px; /* important */
/* non-important styling bellow */
padding-bottom:10px;
}

#carousel_ul li{
float: left; /* important for inline positioning of the list items */                                  
width:200px;  /* fixed width, important */
/* just styling bellow*/
padding:0px;
height:110px;
background: #000000;
margin-top:10px;
margin-bottom:10px;
margin-left:5px;
margin-right:5px;
}

#carousel_ul li img {
.margin-bottom:-4px; /* IE is making a 4px gap bellow an image inside of an anchor (<a href...>) so this is to fix that*/
/* styling */
cursor:pointer;
cursor: hand;
border:0px;
}
#left_scroll, #right_scroll{
float:left;
height:130px;
width:15px;
background: #C0C0C0;
}
#left_scroll img, #right_scroll img{
/*styling*/
cursor: pointer;
cursor: hand;
}
</style>
</head>
<body>
  <div id='carousel_container'>
 <div id='left_scroll'><img src='http://web.enavu.com/demos/left.png' /></div>
  <div id='carousel_inner'>
        <ul id='carousel_ul'>
            <li><a href='#'><img src='https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcT0-t7aRQx24Y9VRys7mW2C3asKXgonkCVMisvPUXqAeE-MhIBgWw' /></a></li>
            <li><a href='#'><img src='http://www.tengopaginaweb.com/apellidobeltri/Escudo%20Belltree.gif' /></a></li>
            <li><a href='#'><img src='http://t3.gstatic.com/images?q=tbn:ANd9GcRHMKEj0It-nMhbdHkpteYv42KFsbhsL1Up0UyEnj5ZxMcgSaUjyFg294jj' /></a></li>
            <li><a href='#'><img src='http://imagenesfotos.com/wp-content/2009/10/escudos11.JPG' /></a></li>
            <li><a href='#'><img src='http://imagenesfotos.com/wp-content/2009/10/escudos11.JPG' /></a></li>
        </ul>
  </div>
  <div id='right_scroll'><img src='http://web.enavu.com/demos/right.png' /></div>
  </div>
</body>
</html>

CommentFB