Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1513

    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.

    #35498

    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.

    #35499

    Hi!!!!

    Im trying to use this code for the same propose but didn´t worck.

    Can you help me PLS

    #35500

    I’m sorry – I can’t to look into this problem as it would take too long.

    #35501

    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;

    #35502

    Thanks theb3s7 for providing the code :)

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Avia Slider Next/Prev buttons’ is closed to new replies.