pgwslider.js
function(elementId, apiController, direction) {

            if (elementId == pgwSlider.currentSlide) {
                return false;
            }

            var element = pgwSlider.data[elementId - 1];

            if (typeof element == 'undefined') {
                throw new Error('PgwSlider - The element ' + elementId + ' is undefined');
                return false;
            }

            if (typeof direction == 'undefined') {
                direction = 'left';
            }

            // Before slide
            if (typeof pgwSlider.config.beforeSlide == 'function') {
                pgwSlider.config.beforeSlide(elementId);
            }

            if (typeof pgwSlider.plugin.find('.ps-caption').fadeOut == 'function') {
                pgwSlider.plugin.find('.ps-caption, .ps-prev, .ps-next').fadeOut(pgwSlider.config.transitionDuration / 2);
            } else {
                pgwSlider.plugin.find('.ps-caption, .ps-prev, .ps-next').hide();
            }

            // Choose the transition effect
            if (pgwSlider.config.transitionEffect == 'sliding') {
                slideElement(element, direction);
            } else {
                fadeElement(element);
            }

            // Reset interval to avoid a half interval after an API control
            if (typeof apiController != 'undefined' && pgwSlider.config.autoSlide) {
                activateInterval();
            }

            return true;
        }
function(elementId, apiController, direction) {

            if (elementId == pgwSlider.currentSlide) {
                return false;
            }

            var element = pgwSlider.data[elementId - 1];

            if (typeof element == 'undefined') {
                throw new Error('PgwSlider - The element ' + elementId + ' is undefined');
                return false;
            }

            if (typeof direction == 'undefined') {
                direction = 'left';
            }

            // Before slide
            if (typeof pgwSlider.config.beforeSlide == 'function') {
                pgwSlider.config.beforeSlide(elementId);
            }

            if (typeof pgwSlider.plugin.find('.ps-caption').fadeOut == 'function') {
                pgwSlider.plugin.find('.ps-caption, .ps-prev, .ps-next').fadeOut(pgwSlider.config.transitionDuration / 2);
            } else {
                pgwSlider.plugin.find('.ps-caption, .ps-prev, .ps-next').hide();
            }

            // Choose the transition effect
            if (pgwSlider.config.transitionEffect == 'sliding') {
                slideElement(element, direction);
            } else {
                fadeElement(element);
            }

            // Reset interval to avoid a half interval after an API control
            if (typeof apiController != 'undefined' && pgwSlider.config.autoSlide) {
                activateInterval();
            }

            return true;
        }
function ( elementId , apiController , direction ) { if ( elementId == pgwSlider . currentSlide ) { return false ; } var element = pgwSlider . data [ elementId - 1 ] ; if ( typeof element == 'undefined' ) { throw new Error ( 'PgwSlider - The element ' + elementId + ' is undefined' ) ; return false ; } if ( typeof direction == 'undefined' ) { direction = 'left' ; } // Before slide if ( typeof pgwSlider . config . beforeSlide == 'function' ) { pgwSlider . config . beforeSlide ( elementId ) ; } if ( typeof pgwSlider . plugin . find ( '.ps-caption' ) . fadeOut == 'function' ) { pgwSlider . plugin . find ( '.ps-caption, .ps-prev, .ps-next' ) . fadeOut ( pgwSlider . config . transitionDuration / 2 ) ; } else { pgwSlider . plugin . find ( '.ps-caption, .ps-prev, .ps-next' ) . hide ( ) ; } // Choose the transition effect if ( pgwSlider . config . transitionEffect == 'sliding' ) { slideElement ( element , direction ) ; } else { fadeElement ( element ) ; } // Reset interval to avoid a half interval after an API control if ( typeof apiController != 'undefined' && pgwSlider . config . autoSlide ) { activateInterval ( ) ; } return true ; }
Display the current element
Display the current element