Slideshow Control problem, one side does not work

Slideshow Control problem, one side does not work

Hi! I am new to jQuery and am trying to adapt a slideshow to fit my layout. I have one end of the slideshow working fine, as you can scroll left with no issue. However, on the right control, the button does not seem to be clickable.

The link to the page is  here.

Here is the template page's code:

  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. <!-- TemplateBeginEditable name="doctitle" -->
  6. <title>DAVIDE MARCHETTI ARCHITETTO</title>
  7. <!-- TemplateEndEditable -->
  8. <style type="text/css">
  9. <!--
  10. /** 
  11.  * Slideshow style rules.
  12.  */
  13. #slideshow {
  14. margin: 0 auto;
  15. width: 702px;
  16. height: 346px;
  17. position: relative;
  18. background-image: url(../images/Davide-border.png);
  19. }
  20. #slideshow #slidesContainer {
  21. margin: 23px auto;
  22. width: 702px;
  23. height: 323px; /* allow scrollbar */
  24. position: relative;
  25. }

  26. /** 
  27.  * Slideshow controls style rules.
  28.  */
  29. .control {
  30.   display:block;
  31.   width:39px;
  32.   height:39px;
  33.   text-indent:-10000px;
  34.   position:absolute;
  35.   cursor: pointer;
  36. }
  37. #leftControl {
  38.   top:0;
  39.   left:650px;
  40.   background:transparent url(images/left_control.png) no-repeat 0 0;
  41. }
  42. #rightControl {
  43.   top:0;
  44.   right:-40px;
  45.   background:transparent url(images/right_control.png) no-repeat 0 0;
  46. }

  47. #slideshow #slidesContainer .slide {
  48.   margin:23px auto;
  49.   width:700px; /* reduce by 20 pixels of #slidesContainer to avoid horizontal scroll */
  50.   height:300px;
  51. }

  52. /** 
  53.  * Style rules for Demo page
  54.  */
  55. * {
  56. margin: 0;
  57. padding: 0;
  58. color: #000;
  59. font-family: "Courier New", Courier, monospace;
  60. font-size: xx-small;
  61. font-style: normal;
  62. font-weight: normal;
  63. font-variant: normal;
  64. }
  65. a {
  66.   color: #fff;
  67.   font-weight:bold;
  68.   text-decoration:none;
  69. }
  70. a:hover {
  71.   text-decoration:underline;
  72. }
  73. body {
  74.   background:#FFFFFF;
  75. }
  76. #pageContainer {
  77.   margin:0 auto;
  78.   width:960px;
  79. }
  80. #pageContainer h1 {
  81.   display:block;
  82.   width:960px;
  83.   height:114px;
  84.   background:#FFFFFF;
  85.   text-indent: -10000px;
  86. }
  87. .slide h2, .slide p {
  88.   margin:15px;
  89. }
  90. .slide h2 {
  91.   font:italic 24px Georgia, "Times New Roman", Times, serif;
  92.   color:#ccc;
  93.   letter-spacing:-1px;
  94. }
  95. .slide img {
  96.   float:right;
  97.   margin:0 15px;
  98. }
  99. #footer {
  100.   height:100px;
  101. }
  102. #footer p {
  103. margin: 30px auto 0 auto;
  104. display: block;
  105. width: 703px;
  106. height: 40px;
  107. color: #000;
  108. font-family: "Courier New", Courier, monospace;
  109. }
  110. body,td,th {
  111. color: #000000;
  112. }
  113. #pageContainer #footer p a {
  114. color: #000;
  115. }
  116. #apDiv1 {
  117. position: absolute;
  118. width: 32px;
  119. height: 1px;
  120. z-index: 1;
  121. left: 130px;
  122. top: 441px;
  123. }
  124. #apDiv2 {
  125. position: absolute;
  126. width: 22px;
  127. height: 4px;
  128. z-index: 1;
  129. left: 0px;
  130. top: 327px;
  131. }
  132. #apDiv3 {
  133. position: absolute;
  134. width: 3px;
  135. height: 0px;
  136. z-index: 1;
  137. left: 214px;
  138. top: 328px;
  139. }
  140. #apDiv4 {
  141. position: absolute;
  142. width: 0px;
  143. height: 0px;
  144. z-index: 1;
  145. left: 442px;
  146. top: 328px;
  147. }
  148. #apDiv5 {
  149. position: absolute;
  150. width: 0px;
  151. height: 4px;
  152. z-index: 1;
  153. left: 655px;
  154. top: 328px;
  155. }
  156. #apDiv6 {
  157. position: absolute;
  158. width: 49px;
  159. height: 3px;
  160. z-index: 1;
  161. left: 1px;
  162. top: 0px;
  163. }
  164. -->
  165. </style>
  166. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  167. <script type="text/javascript">
  168. $(document).ready(function(){
  169.   var currentPosition = 0;
  170.   var slideWidth = 723;
  171.   var slides = $('.slide');
  172.   var numberOfSlides = slides.length;

  173.   // Remove scrollbar in JS
  174.   $('#slidesContainer').css('overflow', 'hidden');

  175.   // Wrap all .slides with #slideInner div
  176.   slides
  177.     .wrapAll('<div id="slideInner"></div>')
  178.     // Float left to display horizontally, readjust .slides width
  179. .css({
  180.       'float' : 'left',
  181.       'width' : slideWidth
  182.     });

  183.   // Set #slideInner width equal to total width of all slides
  184.   $('#slideInner').css('width', slideWidth * numberOfSlides);

  185.   // Insert controls in the DOM
  186.   $('#slideshow')
  187.     .prepend('<span class="control" id="leftControl">Clicking moves left</span>')
  188.     .append('<span class="control" id="rightControl">Clicking moves right</span>');

  189.   // Hide left arrow control on first load
  190.   manageControls(currentPosition);
  191.   
  192. $('slideInner').animate({
  193. 'marginLeft' : slideWidth*(-currentPosition)
  194. });

  195.   // Create event listeners for .controls clicks
  196.   $('.control')
  197.     .bind('click', function(){
  198.     // Determine new position
  199. currentPosition = ($(this).attr('id')=='rightControl') ? currentPosition+1 : currentPosition-1;
  200.     
  201. // Hide / show controls
  202.     manageControls(currentPosition);
  203.     // Move slideInner using margin-left
  204.     $('#slideInner').animate({
  205.       'marginLeft' : slideWidth*(-currentPosition)
  206.     });
  207.   });

  208.   // manageControls: Hides and Shows controls depending on currentPosition
  209.   function manageControls(position){
  210.     // Hide left arrow if position is first slide
  211. if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }
  212. // Hide right arrow if position is last slide
  213.     if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }
  214.   }
  215. });

  216. function autoshow(){
  217. //alert(‘start’);
  218. currentPosition = currentPosition+1 ;
  219. if(currentPosition==numberOfSlides){
  220. currentPosition=0;
  221. }
  222. // Hide / show controls
  223. manageControls(currentPosition);
  224. // Move slideInner using margin-left
  225. $('#slideInner').animate({
  226. 'marginLeft' : slideWidth*(-currentPosition)
  227. });
  228. setTimeout(autoshow, 5000);
  229. }

  230. </script>
  231. <!-- TemplateBeginEditable name="head" -->
  232. <!-- TemplateEndEditable -->
  233. </head>
  234. <body text="#000000">
  235. <div id="pageContainer">
  236.   <h1><a href="">Davide Marchetti Architetto</a></h1>
  237.   <!-- Slideshow HTML -->
  238.   
  239.   <div id="slideshow"><!-- TemplateBeginEditable name="EditRegion1" -->
  240.   
  241.      <div id="apDiv6"><a href="index.html"><img src="../images/hd-main.png" width="178" height="20" /></a></div>
  242.     <div id="apDiv5"><a href="contact.html"><img src="../images/hd-contact.png" width="47" height="19" usemap="#Map2" border="0" />
  243.         <map name="Map2" id="Map2">
  244.           <area shape="rect" coords="-5,-1,62,30" href="contact.html" />
  245.     </map>
  246.   </a></div>
  247.   <div id="apDiv4"><a href="projects.html"><img src="../images/hd-projects.png" width="55" height="19" usemap="#Map" border="0" />
  248.         <map name="Map" id="Map">
  249.           <area shape="rect" coords="-2,-1,60,19" href="#" />
  250.         </map>
  251.     </a></div>
  252.   <div id="apDiv3"><a href="studio.html"><img src="../images/hd-studio.png" width="41" height="19" usemap="#studioMap" longdesc="studio.html" border="0" />
  253.         <map name="studioMap" id="studioMap">
  254.           <area shape="rect" coords="-8,-2,78,22" href="#" target="studio.html" />
  255.         </map>
  256.     </a></div>
  257.     <div id="apDiv2"><a href="news.html"><img src="../images/hd-news.png" width="78" height="19" usemap="#newsMap" border="0" />
  258.         <map name="newsMap" id="newsMap">
  259.           <area shape="rect" coords="-12,-10,164,65" href="#" />
  260.         </map>
  261.        
  262.     </a></div>

  263.     <div id="slidesContainer">
  264.       <div class="slide">
  265.         <!-- IMAGE ONE -->
  266.       </div>
  267.       <div class="slide">
  268.         <!-- IMAGE ONE -->
  269.       </div>
  270.       <div class="slide">
  271.         <!-- IMAGE ONE -->
  272.       </div>
  273.       <div class="slide">
  274.         <!-- IMAGE ONE -->
  275.       </div>
  276.     </div>

  277.   <!-- TemplateEndEditable --></div>
  278.   <!-- Slideshow HTML -->
  279.   <div id="footer">
  280.     <p align="right"><a href="http://erinpellegrino.com">Website  by Erin Pellegrino</a></p>
  281.   </div>
  282.    

  283. </div>
  284. </body>
  285. </html>

Above is the code.