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 7401093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:22:39+00:00 2026-05-29T04:22:39+00:00

I am using Jquery UI Tabs for my website. <script type=’text/javascript’> //<![CDATA[ jQuery(window).load(function(){ jQuery(‘#myTabs’).tabs({

  • 0

I am using Jquery UI Tabs for my website.

<script type='text/javascript'>
//<![CDATA[ 
jQuery(window).load(function(){
jQuery('#myTabs').tabs({ fx: { opacity: 'toggle' }});

jQuery('.next-product').click(function(){ 
var jQuerytabs = jQuery('#myTabs').tabs();
var selected = jQuerytabs.tabs('option', 'selected');
jQuerytabs.tabs('select', selected+1);
});

jQuery('.previous-product').click(function(){ 
var jQuerytabs = jQuery('#myTabs').tabs();
var selected = jQuerytabs.tabs('option', 'selected');
jQuerytabs.tabs('select', selected-1);
}); 

As you can see that i have been using the previous next button to move from one tab to another.
My question is “When i click on next and if the last tab is open then automatically the first tab should get open, and similarly When i click on previous and if the first tab is open then automatically the last tab should get open“

Please help me out, i am stuck from over 3 days now and no solution. I have searched a lot on net but no solution for this.

  • 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-29T04:22:40+00:00Added an answer on May 29, 2026 at 4:22 am

    You can count the number of .ui-tabs-panel elements.

    jQuery(window).load(function() {
    
        var $tabs = jQuery('#myTabs');
    
        $tabs.tabs({
            fx: {
                opacity: 'toggle'
            }
        });
    
        var amount = $tabs.find('.ui-tabs-panel').length;
    
        jQuery('.next-product').click(function() {
            var selected = $tabs.tabs('option', 'selected');
            $tabs.tabs('select', selected + 1 === amount ? 0 : selected + 1);
        });
    
        jQuery('.previous-product').click(function() {
            var selected = $tabs.tabs('option', 'selected');
            $tabs.tabs('select', selected === 0 ? amount - 1 : selected - 1);
        });
    
    });
    

    DEMO

    Notes:

    • select your tab element already and re-use the selector var $tabs = jQuery('#myTabs');, it’ll be more efficient
    • no need to re-call .tabs() on your click handlers
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery-ui tabs and ajax to load the content of the tabs.
I'm making a website using the jQuery UI Tabs plugin which is great. However,
I am using jquery tabs to load content from a remote file. I have
I'm using JQuery UI tabs with cookie like this. jQuery(document).ready(function() { jQuery(#tabs).tabs({cookie: { expires:
I'm using jQuery UI tabs for product pages on my website. On some pages
So I need to open tabs from my website to other websites using JavaScript
I have a page that is using jQuery tabs. Within one of my tabs
I am using jquery UI tabs I have three ajax tabs like so: <div
I am using jQuery UI Tabs . <div id=tabs> <ul id=tablist> <li><a href=#fragment-1><span>One</span></a></li> </ul>
I'm using the jquery tabs plugin and want to have the background a light

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.