I'm using the coda-slider like in example 2. Now I don't want the behavior that the slider rewinds back to the first element if it is on the last element. I want that the slider only moves in the right direction (and of course starts with the first element).
The coda slider seems to use the jQuery animate
function:
function autoSlide() {
if (navClicks == 0 || !settings.autoSlideStopWhenClicked) {
if (currentPanel == panelCount) {
var offset = 0;
currentPanel = 1;
} else {
var offset = - (panelWidth*currentPanel);
currentPanel += 1;
};
alterPanelHeight(currentPanel - 1);
// Switch the current tab:
slider.siblings('.coda-nav').find('a').removeClass('current').parents('ul').find('li:eq(' + (currentPanel - 1) + ') a').addClass('current');
// Slide:
$('.panel-container', slider).animate({ marginLeft: offset }, settings.slideEaseDuration, settings.slideEaseFunction);
setTimeout(autoSlide,settings.autoSlideInterval);
};
};
Are there any chances that a parameter in the animate
function will do the job?
The coda slider itself only supports this parameters.