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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:51:39+00:00 2026-06-08T17:51:39+00:00

I have a page that is using Jquery tabs. The tabs determine not only

  • 0

I have a page that is using Jquery tabs. The tabs determine not only what I want to show in the tab content area, but also outside of the tabs div as well.

The behavior that I want is, when user selects a tab, reload the whole page with new parameters in the url. (I currently do this by tacking string to location.href, thereby forcing the page to reload.

select: function(event, ui) {
    // ... determine new_url
    location.href = new_url;
}

And when the page is reloaded, I want the right tab to be active/selected, and I try to do that by detecting parameter for the tab.

create: function(event, ui) {
   // ... figure out which tab should be selected
   $('.tabs').tabs('select', tab_index);
}

I notice that this forces the browser in unending cycle of create-tabs, select-tab, reload, create-tabs, select-tab… and so on. Is there a way to break out of this?

I realize that JQuery tabs are not for this kind of work but help would be greatly appreciated!! This is my first time trying JQuery tabs.

Some extra notes:
– I am using Rails for some logic
– I attempted to ‘ui-state-active’ class to the tab that should be selected, that seems to be overwritten. First, first tab (index 0) is set to active, and then in the tabs create function, the tab I want to select is selected.

<li class="tab<%= " ui-state-active" if THIS_TAB_SHOULD_BE_SELECTED %>">
  <a href="#tab-<%= type.downcase %>">tab 1</a>
</li>
  • 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-08T17:51:40+00:00Added an answer on June 8, 2026 at 5:51 pm

    You can’t (or shouldn’t) mix tabs that reload page every time the user changes tab with ones that just show/hide some content. I’d recommend sticking with one of the two methods. If you want the whle page to change, either show/hide both tabs and that other content, or ajax the new content and replace the old with the new. Alternately, you could do something like the following:
    HTML:

    <div class="tabs">
      <span class="tab-head active">Tab 1</span>
      <div class="tab-content active">Lorem ipsum...</div>
      <span class="tab-head">Tab 2</span>
      <div class="tab-content">Lorem ipsum...</div>
      <span class="tab-head">Tab 2</span>
      <div class="tab-content">Lorem ipsum...</div>
    </div>
    

    CSS:

    .tabs {overflow: auto;}
    .tab-head {display: inline-block; float:left;}
    .tab-content {display:none;}
    .tab-content-active {display:block;}
    

    JS:

    $(".tabs .tab-head").click(function(){
        $(".tab-content,.tab-head",$(this).parent()).removeClass("active");
        $(this).addClass("active");
        $(this).next(".tab-content").addClass("active");
    });
    

    That’s roughly what I made for another site a few months ago.

    Edit: I’m currently working on a way to assign initial tab positions to every single tabber by passing that data in the fragment_id part of the URL, like this: page.com/path/page.php?foo=bar&baz=quux#tabs=0:1,2:6;, where #tabs=0:1,2:6; is the important part. I’d have an onload handler parse that to show the right tabs form the start and some JS that looks for links that point to the same page with different tab information.

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

Sidebar

Related Questions

I have a page that is using jQuery tabs. Within one of my tabs
I have a page that has two tabs created using jQuery, and I am
I have a simple HTML page that contains two tabs that show/hide content in
I have a page that dynamically creates (using jQuery) Input boxes for the user.
The Scenario Using jQuery, I have a page that has a popup overlay containing
Using the jquery metadata plugin, I have an element on my page that looks
I have a PHP page that loads external content using other PHP files. I'm
I have a problem I am using jquery U.I tabs that load everything with
I have a page on which I'm using jQuery UI Tabs , what I'm
I am using jquery tabs to load content from a remote file. I have

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.