Edit slider so that it automatically slides

Edit slider so that it automatically slides

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Portfolio Image Rotator by Soh Tanaka</title>

  6. <style type="text/css">
  7. body {
  8. margin: 0; padding: 0;
  9. font: normal 10px Verdana, Arial, Helvetica, sans-serif;
  10. }
  11. *{outline: none;}
  12. img {border: 0;}
  13. .container {
  14. width: 960px;
  15. padding: 0;
  16. margin: 0 auto;
  17. }
  18. .folio_block {
  19. margin: 20px 0;
  20. float: left;
  21. clear: both;
  22. width: 100%;
  23. }
  24. .main_view {
  25. width: 580px;
  26. height: 294px;
  27. float: left;
  28. padding: 25px;
  29. margin-right: 20px;
  30. background: url(main_view_bg.gif) no-repeat;
  31. position: relative;
  32. }
  33. .window {
  34. height:294px;
  35. width: 580px;
  36. overflow: hidden;
  37. position: relative;
  38. }
  39. .image_reel {
  40. position: absolute;
  41. top: 0; left: 0;
  42. }
  43. .image_reel a {
  44. position: relative;
  45. float: left;
  46. cursor: pointer;
  47. }
  48. .image_reel img {float: left;}
  49. .image_reel a span {
  50. height: 294px;
  51. width: 580px;
  52. float: left;
  53. background: #111 url(icon_view.gif) no-repeat center;
  54. position: absolute;
  55. z-index: 10;
  56. top: 0; left: 0;
  57. }
  58. .paging {
  59. position: absolute;
  60. bottom: 40px; right: -3px;
  61. width: 178px; height:47px;
  62. z-index: 100;
  63. text-align: center;
  64. line-height: 40px;
  65. background: url(paging_bg.png) no-repeat;
  66. display: none;
  67. }
  68. .paging a {
  69. padding: 5px;
  70. text-decoration: none;
  71. color: #fff;
  72. }
  73. .paging a.active {
  74. font-weight: bold; 
  75. background: #0075b1; 
  76. border: 1px solid #005581;
  77. -moz-border-radius: 3px;
  78. -khtml-border-radius: 3px;
  79. -webkit-border-radius: 3px;
  80. }
  81. .paging a:hover {font-weight: bold;}
  82. .desc {
  83. width: 290px;
  84. float: left;
  85. color: #777;
  86. font-size: 1.1em;
  87. padding: 15px 0;
  88. }
  89. .desc h2 {
  90. text-transform: uppercase;
  91. font: normal 2em Georgia, "Times New Roman", Times, serif;
  92. color: #333;
  93. padding: 5px 0; margin: 5px 0;
  94. border-bottom: 1px solid #f0f0f0;
  95. }
  96. .desc h3 {
  97. font-size: 1.3em;
  98. padding: 5px 0; margin: 0;
  99. }
  100. .desc ul.services {
  101. padding: 0; margin: 0 0 0 15px; 
  102. list-style: none;
  103. }
  104. .desc ul.services li {
  105. background: url(icon_check.gif) no-repeat left center;
  106. padding: 3px 5px 3px 20px; margin: 0;
  107. }
  108. </style>

  109. </head>

  110. <body>
  111. <div class="container">

  112.     <div class="folio_block">
  113.         <div class="main_view">
  114.             <div class="window">
  115.                 <div class="image_reel">
  116.                     <a href="#"><img src="sample1.jpg" alt="" /></a>
  117.                     <a href="#"><img src="sample2.jpg" alt="" /></a>
  118.                     <a href="#"><img src="sample3.jpg" alt="" /></a>
  119.                     <a href="#"><img src="sample4.jpg" alt="" /></a>
  120.                 </div>
  121.             </div>
  122.             <div class="paging">
  123.                 <a href="#" rel="1">1</a>
  124.                 <a href="#" rel="2">2</a>
  125.                 <a href="#" rel="3">3</a>
  126.                 <a href="#" rel="4">4</a>
  127.             </div>
  128.         </div>
  129.         <div class="desc">
  130.             <h2>Design Bombs</h2>
  131.             <p><strong><a href="http://www.DesignBombs.com">Visit the Site</a></strong></p>
  132.             <h3>Description:</h3>
  133.             <p>Vero indoles refero ventosus paratus jus valde aliquip proprius, lobortis. Patria cogo facilisis huic letalis vel vel importunus. Melior, vel ex blandit lucidus ut antehabeo, neque, os fere ea neo. Ille in populus sit vel nonummy at.  Acsi patria nimis typicus os ibidem foras. 
  134.     </p>
  135.             <h3>Services:</h3>
  136.             <ul class="services">
  137.                 <li>Design</li>
  138.                 <li>Logo Creation</li>
  139.                 <li>Search Engine Optimization</li>
  140.                 <li>WordPress Development</li>
  141.             </ul>
  142.         </div>
  143.     </div>
  144.     

  145. </div>


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

  148. $(document).ready(function() {


  149. $(".folio_block").each(function() {
  150. //Set Default State of each portfolio piece
  151. $(this).find(".paging").show();
  152. $(this).find(".paging a:first").addClass("active");
  153. //Inject <span> for Tool tip
  154. $(this).find(".image_reel a").append("<span></span>");
  155. $(this).find(".image_reel span").css({"opacity" : "0"});
  156. //Get size of images, how many there are, then determin the size of the image reel.
  157. var windowWidth = $(this).find(".image_reel span").width();
  158. var imageSum = $(this).find(".image_reel img").size();
  159. var imageReelWidth = windowWidth * imageSum;
  160. //Adjust the image reel to its new size
  161. $(this).find(".image_reel").css({'width' : imageReelWidth});
  162. });

  163. //Hover Effect for Tooltip
  164. $(".image_reel a").hover(function() {
  165. $(this).find("span").stop().animate({ opacity: 0.7}, 200 ).show();
  166. }, function() {
  167. $(this).find("span").stop().animate({ opacity: 0}, 200 );
  168. });

  169. //Pagin events
  170. $(".paging a").click(function() {
  171. var triggerID = $(this).attr("rel") - 1;
  172. var imgWidth = $(this).parent().parent().find("img").width();
  173. var image_reelPosition = triggerID * imgWidth;
  174. //Ignore if Active
  175. if ( $(this).hasClass("active")) { 
  176. //Do Nothing
  177. }
  178. else {
  179. //Set active paging
  180. $(this).parent().parent().find(".paging a").removeClass("active");
  181. $(this).addClass("active");

  182. //image_reel Image
  183. $(this).parent().parent().find(".image_reel").animate({ 
  184. left: -image_reelPosition
  185. }, 300 );
  186. }
  187. return false;
  188. });

  189. });
  190. </script>


  191. </body>
  192. </html>

How can I edit the above code so that the slider automatically slides after a few seconds but still retains the function of the paging buttons?