title: Joomla custom Jquery slider error: "Uncaught TypeError: Cannot read property 'fadeOut' of null"
body: <p>I got an error message: "Uncaught TypeError: Cannot read property 'fadeOut' of null"</p>
  
  <p>My slider is working with pagination, but I got the error message while autorun</p>
  
  <p>What wrong with fadeOut() function?
  Here is my code:</p>
  
  <pre><code>jQuery.noConflict();
  
  var speed = 3000;
  var effect = 600;
  run = setInterval("moveRight()", speed);
  
  jQuery(document).ready(function($){
  
      $('#slideshow &gt; div:gt(0)').hide();
      $('#slideshow &gt; div:first').addClass("currentslide");
  
      $("#slideshow-box").append('&lt;div class="slide-nav"&gt;&lt;/div&gt;');
      $("#slideshow &gt; div").each(function(i) {
          $('.slide-nav').append('&lt;a&gt;&lt;/a&gt;');
      });
      $('.slide-nav a:first').addClass("active");
  
      $(".slide-nav a").click(function() {
          $(this).addClass("active");
          $(this).siblings().removeClass("active");
          var goslide = $(this).index();
          $('#slideshow &gt; div').eq(goslide).siblings("div").fadeOut(effect);
          $('#slideshow &gt; div').eq(goslide).fadeIn(effect);
          clearInterval(run);
          run = setInterval("moveRight()", speed);
      });
  });
  
  function moveRight() {
  var nextitem = $("#slideshow .currentslide").fadeOut(effect).removeClass('.currentslide').next('#slideshow &gt; div');
  if (nextitem.length === 0) {
          nextitem = $('#slideshow &gt; div').first();
      }
      nextitem.fadeIn(effect).addClass('active');
  
      var a = $(".slide-nav a.active");
      if (a.length) {
          var $next = a.next();
          if ($next.length == 0) $next = $(".slide-nav a").first();
          a.removeClass("active");
          $next.addClass("active");
      }
  };
  </code></pre>