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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:04:21+00:00 2026-05-11T22:04:21+00:00

I have three divs with the class ‘thumbs’ and they are used to select

  • 0

I have three divs with the class ‘thumbs’ and they are used to select products. I’m currently using the following code to highlight the current choice:

$('.thumbs').hover(function(){                                 
$(this).stop().fadeTo("normal", 1.0);
},function(){
$(this).stop().fadeTo("slow", 0.5);
});

By default all choices are at 50% opacity, when you hover over the choice it will fade to 100% opacity and when you move your mouse it will go back to 50%. The problem is I want it to stay at 100% when an option is clicked, and then only have the other 2 options changed on hover. Then when another option is clicks I want that to go to 100% opacity and the others to go back to 50%. I hope I’ve explained myself well, if not feel free to comment. Any help would be greatly appreciated.

  • 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-11T22:04:22+00:00Added an answer on May 11, 2026 at 10:04 pm
    $(window).bind("load", function() {
        var activeOpacity   = 1.0,
            inactiveOpacity = 0.5,
            fadeTime = "slow",
            clickedClass = "selected",
            thumbs = ".thumbs";
    
        $(thumbs).hide();
        $(thumbs).fadeTo(1, inactiveOpacity);
    
        $(thumbs).hover(
            function(){
                $(this).fadeTo(fadeTime, activeOpacity);
            },
            function(){
                // Only fade out if the user hasn't clicked the thumb
                if(!$(this).hasClass(clickedClass)) {
                    $(this).fadeTo(fadeTime, inactiveOpacity);
                }
            });
         $(thumbs).click(function() {
             // Remove selected class from any elements other than this
             var previous = $(thumbs + '.' + clickedClass).eq();
             var clicked = $(this);
             if(clicked !== previous) {
                 previous.removeClass(clickedClass);
             }
             clicked.addClass(clickedClass).fadeTo(fadeTime, activeOpacity);
         });
    });
    

    I think that will help. I had the same problem and someone here on Stackoverflow made that script for me. And it works perfect!
    (I edited a few things…)

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

Sidebar

Related Questions

I have three divs: A, B and C. A is currently visible and I
I have three Divs on the page and they are absolute positioned. Lets call
I have three divs with float:left <div class=center> <div class=fade1></div> <div class=fade2></div> <div class=fade3></div>
I wish to avoid using css transitions. I have three divs of the same
I have the following code: // Hide all divs that are not the default
I have the following code: HTML: <div class=sectionInner><div class=carousel></div></div> <div class=sectionInner></div> <div class=sectionInner></div> <div
I have the following HTML: <ul> <li class=one><a href=#>one</a></li> <li class=two><a href=#>two</a></li> <li class=three><a
I have three divs: <div class=A>A</div> <div class=B>B</div> <div class=C>C</div> I want them to
Have three divs in a container that I want to float over a large
I have three divs vertically stacked. Header, content and footer. All of them have

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.