Edit slider so that it automatically slides
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Portfolio Image Rotator by Soh Tanaka</title>
- <style type="text/css">
- body {
- margin: 0; padding: 0;
- font: normal 10px Verdana, Arial, Helvetica, sans-serif;
- }
- *{outline: none;}
- img {border: 0;}
- .container {
- width: 960px;
- padding: 0;
- margin: 0 auto;
- }
- .folio_block {
- margin: 20px 0;
- float: left;
- clear: both;
- width: 100%;
- }
- .main_view {
- width: 580px;
- height: 294px;
- float: left;
- padding: 25px;
- margin-right: 20px;
- background: url(main_view_bg.gif) no-repeat;
- position: relative;
- }
- .window {
- height:294px;
- width: 580px;
- overflow: hidden;
- position: relative;
- }
- .image_reel {
- position: absolute;
- top: 0; left: 0;
- }
- .image_reel a {
- position: relative;
- float: left;
- cursor: pointer;
- }
- .image_reel img {float: left;}
- .image_reel a span {
- height: 294px;
- width: 580px;
- float: left;
- background: #111 url(icon_view.gif) no-repeat center;
- position: absolute;
- z-index: 10;
- top: 0; left: 0;
- }
- .paging {
- position: absolute;
- bottom: 40px; right: -3px;
- width: 178px; height:47px;
- z-index: 100;
- text-align: center;
- line-height: 40px;
- background: url(paging_bg.png) no-repeat;
- display: none;
- }
- .paging a {
- padding: 5px;
- text-decoration: none;
- color: #fff;
- }
- .paging a.active {
- font-weight: bold;
- background: #0075b1;
- border: 1px solid #005581;
- -moz-border-radius: 3px;
- -khtml-border-radius: 3px;
- -webkit-border-radius: 3px;
- }
- .paging a:hover {font-weight: bold;}
- .desc {
- width: 290px;
- float: left;
- color: #777;
- font-size: 1.1em;
- padding: 15px 0;
- }
- .desc h2 {
- text-transform: uppercase;
- font: normal 2em Georgia, "Times New Roman", Times, serif;
- color: #333;
- padding: 5px 0; margin: 5px 0;
- border-bottom: 1px solid #f0f0f0;
- }
- .desc h3 {
- font-size: 1.3em;
- padding: 5px 0; margin: 0;
- }
- .desc ul.services {
- padding: 0; margin: 0 0 0 15px;
- list-style: none;
- }
- .desc ul.services li {
- background: url(icon_check.gif) no-repeat left center;
- padding: 3px 5px 3px 20px; margin: 0;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="folio_block">
- <div class="main_view">
- <div class="window">
- <div class="image_reel">
- <a href="#"><img src="sample1.jpg" alt="" /></a>
- <a href="#"><img src="sample2.jpg" alt="" /></a>
- <a href="#"><img src="sample3.jpg" alt="" /></a>
- <a href="#"><img src="sample4.jpg" alt="" /></a>
- </div>
- </div>
- <div class="paging">
- <a href="#" rel="1">1</a>
- <a href="#" rel="2">2</a>
- <a href="#" rel="3">3</a>
- <a href="#" rel="4">4</a>
- </div>
- </div>
- <div class="desc">
- <h2>Design Bombs</h2>
- <p><strong><a href="http://www.DesignBombs.com">Visit the Site</a></strong></p>
- <h3>Description:</h3>
- <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.
- </p>
- <h3>Services:</h3>
- <ul class="services">
- <li>Design</li>
- <li>Logo Creation</li>
- <li>Search Engine Optimization</li>
- <li>WordPress Development</li>
- </ul>
- </div>
- </div>
-
-
- </div>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- $(".folio_block").each(function() {
-
- //Set Default State of each portfolio piece
- $(this).find(".paging").show();
- $(this).find(".paging a:first").addClass("active");
-
- //Inject <span> for Tool tip
- $(this).find(".image_reel a").append("<span></span>");
- $(this).find(".image_reel span").css({"opacity" : "0"});
-
- //Get size of images, how many there are, then determin the size of the image reel.
- var windowWidth = $(this).find(".image_reel span").width();
- var imageSum = $(this).find(".image_reel img").size();
- var imageReelWidth = windowWidth * imageSum;
-
- //Adjust the image reel to its new size
- $(this).find(".image_reel").css({'width' : imageReelWidth});
-
- });
- //Hover Effect for Tooltip
- $(".image_reel a").hover(function() {
- $(this).find("span").stop().animate({ opacity: 0.7}, 200 ).show();
- }, function() {
- $(this).find("span").stop().animate({ opacity: 0}, 200 );
- });
- //Pagin events
- $(".paging a").click(function() {
-
- var triggerID = $(this).attr("rel") - 1;
- var imgWidth = $(this).parent().parent().find("img").width();
- var image_reelPosition = triggerID * imgWidth;
-
- //Ignore if Active
- if ( $(this).hasClass("active")) {
- //Do Nothing
- }
- else {
- //Set active paging
- $(this).parent().parent().find(".paging a").removeClass("active");
- $(this).addClass("active");
- //image_reel Image
- $(this).parent().parent().find(".image_reel").animate({
- left: -image_reelPosition
- }, 300 );
- }
- return false;
- });
- });
- </script>
- </body>
- </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?