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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:07:08+00:00 2026-05-11T04:07:08+00:00

So I am pretty new to JQuery and just spent 5 hours getting this

  • 0

So I am pretty new to JQuery and just spent 5 hours getting this working. If anyone has a better approach please I would love to hear.

That is my basic question how can it be done cleaner, more streamline?

What I did was used the minitabs plugin and what the code below will do is toggle custom tabs back and forth. I needed a way to have the one tab blue and the other gray depending what tab I was on. What I hit against was tab1 would stay blue even when I clicked on tab2, just was funky until this fixed it. As you can see it’s not the cleanest approach but it works. I am sure if you want to try this out the minitab plugin can be had here.

http://minitabs.googlecode.com/files/jquery.minitabs.js 

JQuery:

$(document).ready(function(){     $('#tabs').minitabs('slow', 'fade');          $('#tab1').click(function()             {                 var $this = $(this);                 if( $this.is('.removed') )                       {                        $this.removeClass('removed');                        $this.addClass('selected');                        $('#tab2').removeClass('selected');                        $('#tab2').addClass('removed');                 } else {                        $('#tab2').removeClass('selected');              }     return false;         });         $('#tab2').click(function()             {                 var $this = $(this);                 if( $this.is('.removed') )                    {                         $this.removeClass('removed');                         $this.addClass('selected');                        $('#tab1').removeClass('selected');                        $('#tab1').addClass('removed');                 } else {                        $('#tab1').removeClass('selected');                }                 return false;         });    }); 

Body:

<div id='tabs'>            <ul>             <li><a href='#quick-links' class='tab-l selected' id='tab1'>tab-l</a></li>             <li><a href='#newsletter-link' class='tab-r removed' id='tab2'>tab-r</a></li>         </ul>          <div id='quick-links'> <ul>   <li>Look at me getting myself all in a frenzy!</li>                </ul>         </div>          <div id='newsletter-link'>   Sometimes it's would be nice if they reported the fun news!         </div>     </div> 
  • 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. 2026-05-11T04:07:09+00:00Added an answer on May 11, 2026 at 4:07 am

    I looked at this briefly, and didn’t see any problems with this less-complex setup which takes advantage of minitabs automatically applying the class ‘current’ to the currently selected tab:

    <head>     <style type='text/css'>     .tabs a {         background: grey;     }     .tabs a.current {         background: blue;     }     </style>     <script type='text/javascript'>     $(document).ready(function(){         $('#tabs').minitabs('slow', 'fade');     });     </script> </head> <body>     <div id='tabs'>         <ul class='tabs'>             <li><a href='#quick-links' class='tab-l current' id='tab1'>tab-l</a></li>             <li><a href='#newsletter-link' class='tab-r' id='tab2'>tab-r</a></li>         </ul>          <div id='quick-links'>             <ul>                 <li>Look at me getting myself all in a frenzy!</li>             </ul>         </div>          <div id='newsletter-link'>             Sometimes it's would be nice if they reported the fun news!         </div>     </div> </body> 

    For me that handles the case you describe perfectly.

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

Sidebar

Ask A Question

Stats

  • Questions 73k
  • Answers 73k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Jacl is looking for pkgIndex in the variable auto_path if… May 11, 2026 at 1:53 pm
  • added an answer Have you tried Tools/Options/Text Editor/HTML ? May 11, 2026 at 1:53 pm
  • added an answer A char is the smallest possible type. If you happen… May 11, 2026 at 1:53 pm

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.