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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:03:43+00:00 2026-06-13T00:03:43+00:00

I am creating the tabs dynamically.Everything is working fine.But by default it insert the

  • 0

I am creating the tabs dynamically.Everything is working fine.But by default it insert the tab at last. In some scenario i want to add the
tab at specific postion.For Example:- I have add two tabs i.e Tab1,Tab2 . Now if i add 3rd tab, it should be added at index1 which is
between Tab1 and Tab2

On ready initializing the tabs as below

   var $tabs = $( "#tabs_selector").tabs
        ({
            tabTemplate: '<li><a href='#{href}'>#{label}</a> <span class='ui-icon ui-icon-close'></span></li>',
         add: function( event, ui )
         {
            $tabs.tabs('select',ui.panel.id);
            return false;
         }
    });

// now on click of some link i call below function which inserts the tab dynamically. My question is can i mention the index postion
somewhere so that tab is inserted at that position instead of insertion at last?

function inserTab()
 {
     var tabs = $('#tabs_selector').tabs();
     tabs.tabs( "add", url, title);// is there any idex paramter too here?
 }
  • 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-06-13T00:03:44+00:00Added an answer on June 13, 2026 at 12:03 am

    There’s an optional 4th parameter when adding one:

    .tabs( "add" , url , label , [index] )
    

    So you should be able to pick where you want to add it!

    Although maybe you shouldn’t be using the “add” method, as it has now been deprecated: http://jqueryui.com/upgrade-guide/1.9/#deprecated-add-and-remove-methods-and-events-use-refresh-method

    Maybe something like this would work:

    // Find the first tab (change the eq(1) to get a different one)
    var firstTab = $( "#tabs" ).find( ".ui-tabs-nav li:eq(1)" );
    // create the new tab HTML
    var newTab = $( "<li><a href='/remote/tab.html'>New Tab</a></li>" );
    // add the new tab after the 1st one we found
    firstTab.after(newTab);
    // Refresh the tabs widget
    $( "tabs" ).tabs( "refresh" );
    

    Untested, but should be roughly correct based on the docs!

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

Sidebar

Related Questions

I am creating some tabs using labels, then im going to add some simple
I am creating jquery tabs dynamically. I want to associate the the id to
I am creating dynamically jQuery tabs. I want to assign the id to each
I like to use JQuery for creating tabs. My issue is all jquery tab
I am creating my first tab controller app. I have 2 tabs with 2
I am creating multiple tabs dynamically when my application starts up. Put it this
I am creating a web application and I want to use the Tabs widget
I’m creating a tab based application. One of the tabs is test, and another
I have to tabs, new and REPORTS. In the REPORTS tab, I'm creating a
I am using multiview with asp menu creating tabs in menu. but by switching

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.