JavaScript API

You can easily access to some of the features of your slider through our JavaScript API. This API currently allows you to change the next or previous slide and also to go a specific slide.

To access the API, the first thing you should do, is to get the id of your slider.

In my example the 114 will be the access id to the slider.

njQuery('#nextend-smart-slider-114').smartslider('command', [parameter1, [parameter2, ...]]);

Go to next slide

njQuery('#nextend-smart-slider-114').smartslider('next');

Go to previous slide

njQuery('#nextend-smart-slider-114').smartslider('previous');

Go to a slide by index

Slides are indexed with the starting value of 0. So the first slide index is 0, the second is 1 etc…

Go to first slide:
njQuery('#nextend-smart-slider-114').smartslider('goto', 0);

Go to third slide:
njQuery('#nextend-smart-slider-114').smartslider('goto', 2);

Stop autoplay

You can pause your autoplay too, if you want to, for example with using this js code as your mouseenter event, and the next one as your mouseleave event.
njQuery('#nextend-smart-slider-114').smartslider('pauseautoplay');

Continue autoplay

njQuery('#nextend-smart-slider-114').smartslider('startautoplay');

Usage examples

You can find some examples in here.