是否可以更改Nivo Slider controlNav点的顺序?
DOM生成的元素是这样的:
<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>
感谢
答案 0 :(得分:1)
我更改了jquery.nivo.slider.js文件,如下所示: 评论有变化!
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');
});
}
和这部分:
vars.currentSlide--; //instead of ++
startSlide: 4, // change from 0 to [number of slides-1]