title: jquery image slider auto play and click
body: <p>Please suggest any change where i need to make in this code in order to make this slider auto play after 4000 milliseconds.right not it is working fine on click.i made few changes after following few suggestions but its not working</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
  $(function() {    
  var Page = (function() {    
  var $navArrows = $( '#nav-arrows' ),
  $nav = $( '#nav-dots &gt; span' ),
  slitslider = $( '#slider' ).slitslider( {
  onBeforeChange : function( slide, pos ) {
  
  $nav.removeClass( 'nav-dot-current' );
  $nav.eq( pos ).addClass( 'nav-dot-current' );    
  }
  } ),    
  init = function() {    
  initEvents();    
  },
  initEvents = function() {    
  // add navigation events
  $navArrows.children( ':last' ).on( 'click', function() {    
  slitslider.next();
  return false;    
  } );    
  $navArrows.children( ':first' ).on( 'click', function() {    
  slitslider.previous();
  return false;    
  } );
  $nav.each( function( i ) {    
  $( this ).on( 'click', function( event ) {    
      var $dot = $( this );    
      if( !slitslider.isActive() ) {    
              $nav.removeClass( 'nav-dot-current' );
              $dot.addClass( 'nav-dot-current' );    
      }    
      slitslider.jump( i + 1 );
      return false;    
  } );    
  } );    
  };    
  return { init : init };    
  })();    
  Page.init();    
  });
  &lt;/script&gt;
  </code></pre>