Martijn
Martijn

Reputation: 93

jQuery slider pagination: Adding callback function

I have set up a fiddle here: http://jsfiddle.net/YHMDN/. It's a slider pagination concept and I want it to display text parts instead of numbers, but having numbers maintained displayed in the slider to refer to different text parts (with perhaps a callback function) and having a scrollbar prompted. Who can help me out?

$(function() {

                var $update = $( '#preview > span' );

                $( "#slider" ).pagination( {
                    total : 100,
                    onChange : function( value ) {
                        $update.text( value );
                    }
                } );

            });

The pagination script github page: https://github.com/codrops/SliderPagination/

Upvotes: 0

Views: 483

Answers (1)

Fezzy
Fezzy

Reputation: 64

Try this:

$update.text($($('nav').find('a')[value-1]).text());

Upvotes: 2

Related Questions