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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:46:03+00:00 2026-05-28T14:46:03+00:00

i have two problem with this jquery method : 1- in css hover and

  • 0

i have two problem with this jquery method :

1- in css hover and active not change link color ! Gallery or Submit

2- after click in tab3 or tab4 ( id 3- id 4 ) hidden tabcontent for id 1.

<div><ul class="tabs">
    <li><a href="#tab1">Gallery</a></li>
    <li><a href="#tab2">Submit</a></li>
    </ul>

    <div class="tab_container">
        <div id="tab1" class="tab_content">
            <!--Content-->
        </div>
        <div id="tab2" class="tab_content">
            <!--Content-->
        </div>
    </div></div>
<div>
    <ul class="tabs">
        <li><a href="#tab3">Gallery</a></li>
        <li><a href="#tab4">Submit</a></li>
    </ul>

    <div class="tab_container">
        <div id="tab3" class="tab_content">
            <!--Content-->
        </div>
        <div id="tab4" class="tab_content">
            <!--Content-->
        </div>
    </div>
</div>

$(document).ready(function() {

    //When page loads...
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab
    $(".tab_content:first").show(); //Show first tab content
    //On Click Event
    $("ul.tabs li").click(function() {

        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active ID content
        return false;
    });

});

ul.tabs {
    margin: 0;
    padding: 0;
    float: left;
    list-style: none;
    height: 32px; /*--Set height of tabs--*/
    border-bottom: 1px solid #999;
    border-left: 1px solid #999;
    width: 100%;
}
ul.tabs li {
    float: left;
    margin: 0;
    padding: 0;
    height: 31px; /*--Subtract 1px from the height of the unordered list--*/
    line-height: 31px; /*--Vertically aligns the text within the tab--*/
    border: 1px solid #999;
    border-left: none;
    margin-bottom: -1px; /*--Pull the list item down 1px--*/
    overflow: hidden;
    position: relative;
    background: #e0e0e0;
}
ul.tabs li a {
    text-decoration: none;
    color: #000;
    display: block;
    font-size: 1.2em;
    padding: 0 20px;
    border: 1px solid #fff; /*--Gives the bevel look with a 1px white border inside the list item--*/
    outline: none;
}
ul.tabs li a:hover {
    background: #ccc;
}
html ul.tabs li.active, html ul.tabs li.active a:hover  { /*--Makes sure that the active tab does not listen to the hover properties--*/
    background: #fff;
    border-bottom: 1px solid #fff; /*--Makes the active tab look like it's connected with its content--*/
}
.tab_container {
    border: 1px solid #999;
    border-top: none;
    overflow: hidden;
    clear: both;
    float: left; width: 100%;
    background: #fff;
}
.tab_content {
    padding: 20px;
    font-size: 1.2em;
}

How To Fix This! LIVE Action Demo

  • 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-28T14:46:04+00:00Added an answer on May 28, 2026 at 2:46 pm

    You are hiding elements by class. $(".tab_content").hide() hides all your content elements regardless of tab setup.

    You should wrap your tabs and it´s content areas and select the element relative to that wrapper element.

    UPDATE

    Created short demo for you.

    $(".myTabs").each(function() {
    
        var $myTabs = $(this);
    
        $myTabs.find(".tab_content").hide().first().show();
        $myTabs.find("ul.tabs li:first").addClass("active").show();
    
        $myTabs.find("ul.tabs li").click(function() {
            var $this = $(this);
    
            $this.addClass("active").siblings().removeClass("active");
            $myTabs.find(".tab_content").hide();
    
            var activeTab = $this.find("a").attr("href");
            $(activeTab).fadeIn();
    
            return false;
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have two problem in this Case : I want to pass a JSON
My problem is this: I have two threads, my UI thread, and a worker
I am wondering how you would approach this problem I have two Taxrates that
So i'm having this problem. I have two tables (Oracle), one is called Destination
Can someone explain to me how I can fix this problem. I have two
I have had this problem w/ two seperate WYSWYG editors in my rails application
I have this little problem. My client wanted two distinct swf on a web
I have a problem with IE causing two errors: 1. Object doesn't support this
In this JSfiddle have I two forms. This is duplicated twice <form action= method=post>
I used pole display(E POS) in my POS c# application.I have two major problem

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.