• Resolved willem de kei

    (@willem-de-kei)


    Dear,

    I am trying SliderPro out and have a problem with automatic looping.

    Is it possible to let the loop stop at the end of the last slide?

    greetings
    Willem

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author bqworks

    (@bqworks)

    Hi,

    This is not a built-in feature, but it can be accomplished with the slider’s JavaScript API :

    jQuery( document ).ready(function( $ ) {
        var slider = $( '.slider-pro' ).data( 'sliderPro' );
    
        $( '.slider-pro' ).on( 'gotoSlide', function( event ) {
            if( event.index === slider.getTotalSlides() - 1 ) {
                slider.stopAutoplay();
            }
        });
    }

    Best,
    David

    Thread Starter willem de kei

    (@willem-de-kei)

    I copied the code as is at the bottom in the file functions.php of my theme directory (Twenty Ten), but then get the next message:

    ParseError thrown
    syntax error, unexpected token “$”, expecting variable

    greetings, Willem

    Plugin Author bqworks

    (@bqworks)

    The code I gave you is JavaScript, while functions.php is for PHP code. In order to add JavaScript code you can install a plugin that allows you to insert JavaScript code, unless you have a theme that provides this options.

    The SliderPro plugin also offers a premium add-on for adding custom JavaScript/CSS that integrates better with the plugin.

    Best,
    David

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘looping stop at the last slide’ is closed to new replies.