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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:28:39+00:00 2026-05-18T05:28:39+00:00

I have adapted a jQuery tabbed interface tutorial to create an interface for viewing

  • 0

I have adapted a jQuery tabbed interface tutorial to create an interface for viewing some images. The active tab should have an opacity of 1, but with the code I am using the ‘current’ class is assigned to the ‘a’ of the tab when clicked, but the opacity does not change, and remains at .3.

I am hoping I can achieve this effect without using the css opacity settings so that it will work with browsers that don’t support this. I am very new to Jquery any help would be much appreciated.

        // Initialize.
function init_tabs() {

// Does element exist?
if (!$('ul.tabs').length) {

// If not, exit.
return;
}

// Reveal initial content area(s).
$('div.tab_content_wrap').each(function() {
$(this).find('div.tab_content:first').show();
});

$('ul.tabs a').css({ opacity: .3 });
$('ul.tabs a.current').css({ opacity: 1 });

$('ul.tabs a:not(.current)').hover(
function () {
$(this).fadeTo("fast", 1);
},
function () {
$(this).fadeTo("fast", .3);
}
);

// Listen for click on tabs.
$('ul.tabs a').click(function() {

// If not current tab.
if (!$(this).hasClass('current')) {

// Change the current indicator.
$(this).addClass('current').css({opacity: 1}).parent('li').siblings('li')
.find('a.current').removeClass('current').css({opacity: .3}),


// Show target, hide others.
$($(this).attr('href')).fadeIn(300).siblings('div.tab_content').hide();
}

// Nofollow.
this.blur();
return false;
});
 }

// Kick things off.
$(document).ready(function() {
init_tabs();

});

  • 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-18T05:28:40+00:00Added an answer on May 18, 2026 at 5:28 am

    The problem seems to be this code:

    $('ul.tabs a:not(.current)').hover(
        function () {
            $(this).fadeTo("fast", 1);
        },
        function () {
            $(this).fadeTo("fast", .3);
        }
    );
    

    You are setting hovers on the non-current tabs. This hover remains in place even after you change the class of the tab. So, you hover over the tab, you click it, it changes to class current and then when you hover out, it fades back to opacity .3, despite the new class name; You need do something to handle the hover for all tabs, even the current one.

    If you change your hover code to this it should work:

    $('ul.tabs a').hover(
        function () {
            if(!$(this).hasClass("current")) {
                $(this).fadeTo("fast", 1);
            }
        },
        function () {       
            if(!$(this).hasClass("current")) {
                $(this).fadeTo("fast", .3);
            }
        }
    );
    

    Example: http://jsfiddle.net/TLshW/

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

Sidebar

Related Questions

So: I have the following function, adapted from a formula found online, which takes
My issue is simple. I have already implemented a tab system, and I'd probably
I'm using the latest CKeditor with jQuery adapter . I have successfully got it
I have adapted the holy grail three column layout into my site and it
Trying to find the sqlserver adapter for rails on windows. I have tried getting
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
Have just started using Visual Studio Professional's built-in unit testing features, which as I
Have you used VS.NET Architect Edition's Application and System diagrams to start designing a

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.