title: Using jQuery With Sitecore
body: <p>I'm trying to get a jQuery slide show working on a web control that I've created. I can get the slide show to work in IE 9 with compatibility mode turned on, but I can't get it to work properly in Chrome or Firefox. </p>
  
  <p>I'm not very experienced with jQuery, so I may be missing something obvious. I'm not sure if using Sitecore as the CMS has something to do with my problem or not.</p>
  
  <p>This is some example code that I found on the web and have been playing around with. Can anyone help? </p>
  
  <p>Thanks! 
  crjunk</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  $(document).ready(function () {
  
      var currentPosition = 0;
      var slideWidth = 500;
      var slides = $('.slide');
      var numberOfSlides = slides.length;
      var slideShowInterval;
      var speed = 3000;
  
  
      slideShowInterval = setInterval(changePosition, speed);
  
      slides.wrapAll('&lt;div id="slidesHolder"&gt;&lt;/div&gt;')
  
      slides.css({ 'float': 'left' });
  
      $('#slidesHolder').css('width', slideWidth * numberOfSlides);
  
  
      (function changePosition() {
          if (currentPosition == numberOfSlides - 1) {
              currentPosition = 0;
          } else {
              currentPosition++;
          }
          moveSlide();
      })(jQuery);
  
  
      (function moveSlide() {
          $('#slidesHolder')
                .animate({ 'marginLeft': slideWidth * (-currentPosition) });
      })(jQuery);
  
  });
  &lt;/script&gt;
  
  
  &lt;div id="slideshow"&gt;
   &lt;div id="slideshowWindow"&gt;
      &lt;div class="slide"&gt;
               &lt;img src="../../images/slider_1.jpg" /&gt;
               &lt;div class="slideText"&gt;
                   &lt;h2 class="slideTitle"&gt;Slide 1&lt;/h2&gt;
                   &lt;p class="slideDes"&gt;Lorem ipsum dolor sit amet, 
                   consectetur adipisicing elit, sed do eiusmod tempor 
                   incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
                   &lt;p class="slideLink"&gt;&lt;a href="#"&gt;click here&lt;/a&gt;&lt;/p&gt;
               &lt;/div&gt;&lt;!--/slideText--&gt;
          &lt;/div&gt;&lt;!--/slide--&gt;
      &lt;div class="slide"&gt;
           &lt;img src="../../images/slider_2.jpg" /&gt;
                   &lt;div class="slideText"&gt;
                   &lt;h2 class="slideTitle"&gt;Slide 2&lt;/h2&gt;
                   &lt;p class="slideDes"&gt;Lorem ipsum dolor sit amet, 
                   consectetur adipisicing elit, sed do eiusmod tempor 
                   incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
                   &lt;p class="slideLink"&gt;&lt;a href="#"&gt;click here&lt;/a&gt;&lt;/p&gt;
               &lt;/div&gt;&lt;!--/slideText--&gt;
      &lt;/div&gt;&lt;!--/slide--&gt;
      &lt;div class="slide"&gt;
           &lt;img src="../../images/slider_3.jpg" /&gt;
                   &lt;div class="slideText"&gt;
                   &lt;h2 class="slideTitle"&gt;Slide 3&lt;/h2&gt;
                   &lt;p class="slideDes"&gt;Lorem ipsum dolor sit amet, 
                   consectetur adipisicing elit, sed do eiusmod tempor 
                   incididunt ut labore et dolore magna aliqua.&lt;/p&gt;
                   &lt;p class="slideLink"&gt;&lt;a href="#"&gt;click here&lt;/a&gt;&lt;/p&gt;
               &lt;/div&gt;&lt;!--/slideText--&gt;
      &lt;/div&gt;&lt;!--/slide--&gt;
   &lt;/div&gt;&lt;!--/slideshowWindow--&gt;
  </code></pre>
  
  <p></p>