Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #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?



    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;

    and something like

    currentSlideNumber --;
    if(currentSlideNumber == 0) currentSlideNumber = slideCount;

    to the previous button.



    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);
    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);

    return this;


    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.