eWizardII
eWizardII

Reputation: 1936

JavaScript tabifier + Control Links

I'm not a pro- at javascript, so I had a quick question, does anyone know how to use the JavaScript tabifier here - http://www.barelyfitz.com/projects/tabber/ and add a link inside of one of the tabs that says like continue, so that way the user can click continue and it will advance to the next tab? As I don't know how to do that.

p.s. if it helps I'm doing this is Rails, but I don't think that's going to be a problem - you can see here what I am doing:

http://ScrnSht.com/akcdhi

So basically inside of the form it would say continue -> goes to tab 3 for example if you're on tab 2.

Thanks,

Upvotes: 0

Views: 218

Answers (1)

Guilherme Nagatomo
Guilherme Nagatomo

Reputation: 306

If you're using the solution can be something like this:

$(".nexttab").click(function(){
    var $active_tab = $(".tabberactive");
    if($active_tab.next().length > 0){
        $active_tab.next().children("a").trigger("click");
    }
});

Explaining the code, you have to create a link with the class "nexttab", and by clicking on it the active tab will be located and if there's a next one the link that shows it will be triggered and the next tab will be displayed.

Upvotes: 1

Related Questions