public/libraries.js
function moveToSlide(index) {
          // Wrap around indices.
          if (index >= $slides.length) index = 0;
          else if (index < 0) index = $slides.length -1;

          $active_index = $slider.find('.active').index();

          // Only do if index changes
          if ($active_index != index) {
            $active = $slides.eq($active_index);
            $caption = $active.find('.caption');

            $active.removeClass('active');
            $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',
                              complete: function() {
                                $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});
                              } });
            captionTransition($caption, options.transition);


            // Update indicators
            if (options.indicators) {
              $indicators.eq($active_index).removeClass('active');
            }

            $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});
            $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});
            $slides.eq(index).addClass('active');


            // Update indicators
            if (options.indicators) {
              $indicators.eq(index).addClass('active');
            }
          }
        }
function moveToSlide(index) {
          // Wrap around indices.
          if (index >= $slides.length) index = 0;
          else if (index < 0) index = $slides.length -1;

          $active_index = $slider.find('.active').index();

          // Only do if index changes
          if ($active_index != index) {
            $active = $slides.eq($active_index);
            $caption = $active.find('.caption');

            $active.removeClass('active');
            $active.velocity({opacity: 0}, {duration: options.transition, queue: false, easing: 'easeOutQuad',
                              complete: function() {
                                $slides.not('.active').velocity({opacity: 0, translateX: 0, translateY: 0}, {duration: 0, queue: false});
                              } });
            captionTransition($caption, options.transition);


            // Update indicators
            if (options.indicators) {
              $indicators.eq($active_index).removeClass('active');
            }

            $slides.eq(index).velocity({opacity: 1}, {duration: options.transition, queue: false, easing: 'easeOutQuad'});
            $slides.eq(index).find('.caption').velocity({opacity: 1, translateX: 0, translateY: 0}, {duration: options.transition, delay: options.transition, queue: false, easing: 'easeOutQuad'});
            $slides.eq(index).addClass('active');


            // Update indicators
            if (options.indicators) {
              $indicators.eq(index).addClass('active');
            }
          }
        }
function moveToSlide ( index ) { // Wrap around indices. if ( index >= $slides . length ) index = 0 ; else if ( index < 0 ) index = $slides . length - 1 ; $active_index = $slider . find ( '.active' ) . index ( ) ; // Only do if index changes if ( $active_index != index ) { $active = $slides . eq ( $active_index ) ; $caption = $active . find ( '.caption' ) ; $active . removeClass ( 'active' ) ; $active . velocity ( { opacity : 0 } , { duration : options . transition , queue : false , easing : 'easeOutQuad' , complete : function ( ) { $slides . not ( '.active' ) . velocity ( { opacity : 0 , translateX : 0 , translateY : 0 } , { duration : 0 , queue : false } ) ; } } ) ; captionTransition ( $caption , options . transition ) ; // Update indicators if ( options . indicators ) { $indicators . eq ( $active_index ) . removeClass ( 'active' ) ; } $slides . eq ( index ) . velocity ( { opacity : 1 } , { duration : options . transition , queue : false , easing : 'easeOutQuad' } ) ; $slides . eq ( index ) . find ( '.caption' ) . velocity ( { opacity : 1 , translateX : 0 , translateY : 0 } , { duration : options . transition , delay : options . transition , queue : false , easing : 'easeOutQuad' } ) ; $slides . eq ( index ) . addClass ( 'active' ) ; // Update indicators if ( options . indicators ) { $indicators . eq ( index ) . addClass ( 'active' ) ; } } }
This function will transition the slide to any index of the next slide
This function will transition the slide to any index of the next slide