Search code examples
jquerysliderdirectionnivo-slider

How to change the order of Nivo Slider controlNav dots?


Is it possible to change the order of Nivo Slider controlNav dots?

DOM generated elements are like this:

<div class="nivo-controlNav">
    <a rel="0" class="nivo-control active">1</a>
    <a rel="1" class="nivo-control">2</a>
    <a rel="2" class="nivo-control">3</a>
</div>

thanks


Solution

  • I changed the jquery.nivo.slider.js file like below: changes are commented!

        if(settings.directionNav){
            slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+ settings.prevText +'</a><a class="nivo-nextNav">'+ settings.nextText +'</a></div>');
    
            $('a.nivo-prevNav', slider).live('click', function(){
                if(vars.running) { return false; }
                clearInterval(timer);
                timer = '';
                vars.currentSlide += 2; //changed from -=2
                nivoRun(slider, kids, settings, 'prev');
            });
    
            $('a.nivo-nextNav', slider).live('click', function(){
                if(vars.running) { return false; }
                clearInterval(timer);
                timer = '';
                nivoRun(slider, kids, settings, 'next');
            });
        }
    

    and this parts:

    vars.currentSlide--; //instead of ++
    startSlide: 4, // change from 0 to [number of slides-1]