Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7704027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:35:35+00:00 2026-05-31T23:35:35+00:00

the tabs are working fine but I need to trigger the NEXT and PREV

  • 0

the tabs are working fine but I need to trigger the NEXT and PREV buttons that currently don’t make the tabs selected

cloud you help me with that?

http://jsfiddle.net/pmnzT/27/

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:35:36+00:00Added an answer on May 31, 2026 at 11:35 pm

    Take advantage of the existing click handler that you have. When you click next, manually trigger the click handler on the next tab, by calling .trigger('click'). I also put the changeTab code in a common call, so you don’t have to replicate code in the next and previous click handlers:

    function changeTab(next){
        var tabs = $('.tabmenu a');  // Get tab links
        var curTab = tabs.index($('.selected'));  // What link # is selected?
        var num = tabs.size();  // How many do we have?
        if(next) {
           // If next, add 1 (mod total, allows wrapping)
           newTab = (curTab+1)%num;
        } else {
           // If prev, sub 1 (add total, mod total, allows wrapping)
           newTab = (curTab+num-1)%num;
        }
        // This manually "clicks" the next tab
        tabs.eq(newTab).trigger('click'); 
    }
    
    $('.next-tab').click(function(){
        // call changeTab(); 1 means next
        changeTab(1);
    });
    
    $('.prev-tab').click(function(){
        // call changeTab();  0 means previous
        changeTab(0);
    });    
    

    Demo: http://jsfiddle.net/baKYK/

    That being said, jQuery UI provides a lot of functionality automatically. Is there a reason you aren’t using it?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all... I've got a jQueryUI tabs implementation that's pretty straightforward and working fine.
I have this tabs that are working perfect in any browser apart from IE
I am currently working with sliding tabs. I am implementing the hover function to
I'm working on a project that makes heavy use of jQuery tabs and Ajax.
This same code working fine with MVC 2 but not working in MVC 3
My site is working fine in Firefox, Safari, Chrome, and Opera, but for some
I am trying to make a menu working as tabs. The tabs themselves are
I'm working in gvim with sessions and tabs, and everything works great. However there
The app I'm working on has 4 tabs, 3 of which share many features,
I'm working on a tab bar application and one of the tabs has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.