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

  • Home
  • SEARCH
  • 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 8262639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:49:13+00:00 2026-06-08T03:49:13+00:00

Below is the code which i have used . default tab is tab1 which

  • 0

Below is the code which i have used . default tab is tab1 which is in red color. when second tab is selected the first tab is still active .How to remove the first tab color when second tab is selected http://jsfiddle.net/JE3e5/12/

<ul class="rtabs"> 
    <li class="active-first"rel="tab1"> <span>Tab1</span></li>
    <li rel="tab2"> <span>Tab2</span></li>
    <li rel="tab3"><span> Tab3</span></li>
    <li rel="tab4" class="last"> <span>Tab4</span></li>
</ul>
<div class="tab_container"> 
 <div id="tab1" class="tab_content"> 
     <p><img src="images/cod.jpg"> <br />
     <strong>
     Call of Duty: Black Ops bears the series' standard superbly,
     delivering an engrossing campaign and exciting competitive multiplayer.
     </strong>
     </p>

  </div>

​css

 .rtabs                { list-style:none; position:relative;padding:0px; margin:20px 0px; font-size:0px; background:#FFF; width:639px; height:29px; display:block; }
.rtabs li         { cursor:pointer;list-style:none; padding:7px 13px; margin:0px;  height:15px; display:inline-block; background:#000; zoom:1; *display: inline; border- right:1px solid #000; }
.rtabs li rel            { cursor:pointer;color:#FFF; font-weight:bold; font-size:13px; text-transform:uppercase; }
.rtabs li span        { color:#BBB; font-weight:bold; font-size:13px; text-transform:uppercase; }
.rtabs li.first        { background:red; padding-left:18px; }
.rtabs li.last        { background:#000; padding-right:18px; border-right:0px; }
.rtabs .active        { background:red; }
.rtabs .active-last    { background:red; padding-right:20px; border-right:0px;}
.rtabs .active-first    { background:red;  padding-left:20px; }

.tab_container {
    border: 1px solid #999999;
    border-top: none;
    clear: both;
    float: left; 
    width: 100%;
    background: #FFFFFF;
}
.tab_content {
    padding: 20px;
    font-size: 1.2em;
    display: none;
}

jquery

$(document).ready(function() {

 $(".tab_content").hide();
 $(".tab_content:first").show(); 

 $("ul.rtabs li").click(function() {
    $("ul.rtabs li").removeClass("active");
    $(this).addClass("active");
    $(".tab_content").hide();
    var activeTab = $(this).attr("rel"); 
    $("#"+activeTab).fadeIn(); 
});
});

​
​

  • 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-08T03:49:16+00:00Added an answer on June 8, 2026 at 3:49 am

    All you need to do is the same thing you are already doing but just add more removeClass() calls for the elements. check out the jsFiddle here for a quick example

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

Sidebar

Related Questions

I have below code which overrides equals() and hashcode() methods. public boolean equals(Object obj)
I want to know is below code correct ? I have following code which
I have the code below which I use clone() and live() . The code
I have the code below which I use clone() and delegate() . The code
I have the following code below which works, but I want to insert values
I have wrote the code below which was taken from Java How to program
I have a working JavaScript code below which dynamically creates JSON object using JSON.parse
I have a function(please see code below) which reads some data from the web.
I have a piece of matlab code below which reads data from a table.
I have below snippet of code in which TestClass is extending jPanel which is

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.