change nivoslider next slide by outside link

1.7k Views Asked by At

i have 2 slides on the page, they are releated so when 1 changes the other one should change on the same time. therefore i made the interval the same.

now for clicking next/prev i need one to change the second.

i have made this:

$("#slider a.nivo-prevNav").live("click", function() {
    TheKids = $("#slider2").children();
    TheSettings = $("#slider2").settings;
    $("#slider2").nivoRun($("#slider2"),TheKids,TheSettings,"prev");
});

but i get error from firebug

$("#slider2").nivoRun is not a function

is there a way to make it work?

1

There are 1 best solutions below

0
On BEST ANSWER

I am assuming you want to trigger slider2's click event to match.

$("#slider a.nio-prevNav").live("click", function() {
   $("#slider2 a.nio-prevNav").trigger('click');
}

So assuming that #slider's image 0 corresponds to #slider2's image 0. Now when you click on #slider's previous button, it will simulate a click on slider2's previous button.