I need to have next/previous buttons on the Avia slider, in place of the default click controls. Is there a function within the slider object I can call to advance to the next or previous slide?
Thanks.
I need to have next/previous buttons on the Avia slider, in place of the default click controls. Is there a function within the slider object I can call to advance to the next or previous slide?
Thanks.
I'm not good at javascript coding but you need to bind a function like the following to the next button:
currentSlideNumber ++;
if(currentSlideNumber == slideCount) currentSlideNumber = 0;
slideWrapper.methods.switchSlide();
and something like
currentSlideNumber --;
if(currentSlideNumber == 0) currentSlideNumber = slideCount;
slideWrapper.methods.switchSlide();
to the previous button.
Hi!!!!
Im trying to use this code for the same propose but didn“t worck.
Can you help me PLS
I'm sorry - I can't to look into this problem as it would take too long.
If you're using the default controls I have a solution for you:
add these methods into slideWrapper.methods object:
prevSlide: function()
{
if (skipSwitch)
return false;
var x = currentSlideNumber - 1;
if(x == -1)
x = slideCount-1;
controlls.find('a:eq('+ x +')').click();
return false;
},
nextSlide: function()
{
if (skipSwitch)
return false;
var x = currentSlideNumber + 1;
if(x == slideCount)
x = 0;
controlls.find('a:eq('+ (x) +')').click();
return false;
},
and also replace the appendControls function with this:
if (options.slideControlls == 'items')
{
var elementToAppend = options.appendControlls || slideWrapper[0];
controlls = $('<div></div>').addClass('slidecontrolls').insertAfter(elementToAppend);
var controllerBack = $('<span style="float: left;cursor:pointer;background: none;width: 28px"> prev </span>').appendTo(controlls);
controllerBack.bind('click', slideWrapper.methods.prevSlide);
slides.each(function(i)
{
var controller = $('<a href="#" class="ie6fix '+current_class+'"></a>').appendTo(controlls);
controller.bind('click', {currentSlideNumber: i}, slideWrapper.methods.switchSlide);
current_class = "";
});
var controllerFwd = $('<span style="float: left;cursor:pointer;background: none;width: 28px"> next </span>').appendTo(controlls);
controllerFwd.bind('click', slideWrapper.methods.nextSlide);
controlls.width(controlls.width()).css('float','none');
}
return this;Thanks theb3s7 for providing the code :)
You must log in to post.