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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:22:17+00:00 2026-05-26T18:22:17+00:00

I have a page with few tabs. I am looking for a way that

  • 0

I have a page with few tabs.
I am looking for a way that if you select tab 5 and cookie = 1 then show tab6 otherwise show tab5.

The code for the tabs is:

jQuery(".tabs a").click(function () {
    stringref = jQuery(this).attr("href").split('#')[1];
    jQuery('.tab_content:not(#' + stringref + ')').hide();
    jQuery('.tab_content#' + stringref).fadeIn();
    return false;
});

I want the tab number 5, if clicked and cookie=1 to show tab6.
The code that shows the div5 or Div6 if cookie is 1 or null is:

alreadyClosed = $.cookie(stateCookieName);

if (alreadyClosed != 1) {
    $DIV5.show();
    $DIV6.hide();
} else {
    $DIV5.hide();
    $DIV6.show();
}

How do I add them together? I assume their should be a way to say:

If tab1.click and cookie = 1 then show $div1
else tab1.click and cookie = null then show $div2

The body looks like:

<!-- buttons -->
<ul id="boxes" class="tabs">
<li><a href="#Div5">Div 5</a></li>
<li><a href="#Div6">Div 6</a></li>
</ul>

<!-- content -->
<div class="tab_content" id="Div5">DIV 5</div>
<div class="tab_content" id="Div6">DIV 6</div>

I hope you guys can help me.
Thanks alot & Regards,
rallyboy.

  • 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-26T18:22:18+00:00Added an answer on May 26, 2026 at 6:22 pm

    After so long I found it out finally. I replaced this click function with this:

    var alreadyClosed = $.cookie(stateCookieName) == '1';
    jQuery('ul.tabs a').click(function () {
        var ref = jQuery(this).attr('href').split('#')[1];
        if (alreadyClosed && ref == 'Div5') {
            ref = 'Div6';
        }
        jQuery('div.tab_content:not(#' + ref + ')').hide();
        jQuery('#' + ref).fadeIn();
        return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this an asp.net 3.5 page that and I have few tabs (telerik
I have a few tabs on a page that have this markup <div id=holiday-details-nav>
Basically I have MVC site with few tabs on my page, that uses JavaScript.
I have a page with a few links that are all like this: <a
I have a page that takes a few minutes to run. When I set
I have a page that I want to update non stop, every few seconds.
I have a module that is being used to create only a few page
I have a simple page with few tabs. The tabs work if disable_function =
In a page I have few tabs and I was asking if its possible
I have a few tabs on a page and it always defaults to the

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.