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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:47:23+00:00 2026-06-03T05:47:23+00:00

Sorry if this is already posted, but I really need your help. What I

  • 0

Sorry if this is already posted, but I really need your help.

What I want is following:

Let’s say I have this image as normal image that can be clicked.
https://i.stack.imgur.com/pGYyG.png

Now let’s say, when I click on that image it will fade this image:
https://i.stack.imgur.com/bUPmP.png

Can anyone tell me how to code this on click image selection ? Or if it cannot be onclick then how else, please?

EDIT:
Also I forgot to mention. If I have 2 selecting choices…
And if I click one choice it fades in and if I select choice 2, choice 1 should fade out and choice 2 fade in like it should…

  • 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-03T05:47:24+00:00Added an answer on June 3, 2026 at 5:47 am

    Presuming by fade, you mean an animated fade, you can use the following code:

    HTML:

    <div id="something" class="theImage" style="height: 242px; width: 194px; background: url(http://i.imgur.com/QW15C.png);">
      <img src="http://i.imgur.com/SOd1W.png" />
    </div>
    
    <div id="somethingElse" class="theImage" style="height: 242px; width: 194px; background: url(http://i.imgur.com/QW15C.png);">
      <img src="http://i.imgur.com/SOd1W.png" />
    </div>
    

    jQuery:

    $(document).ready(function(){
        $('.theImage img').click(function(){
          var current = ($(this).parent().attr('id') == 'something') ? 'somethingElse' : 'something';console.log(current);
          $(this).fadeOut();
          $('#'+current + ' img').fadeIn();
        });
    });
    

    This will show the default image to start off with, then fade out to show the background image of it’s container when clicked. You may decide to use different HTML elements depending on your situation.

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

Sidebar

Related Questions

Sorry if this has already been posted, but I have seen many of them
im sorry if this was posted already i have been looking to no avail..
im sorry if this has already been covered, i have had a look but
Sorry if something similar has been posted here already, but I couldn't really find
Sorry, for double posting, already posted this question once, but I realized I weren't
Sorry if this has already been asked, but I just want to make sure
sorry if this has already been posted but I've been through umpteen posts on
Sorry if this has already been answered but I could not find it here.
Sorry if this has already been answered, but I can't find it if so.
I'm sorry if this was already answered, but it's kind of difficult to search

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.