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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:03:04+00:00 2026-05-31T00:03:04+00:00

I have a set up where I have three squares, the first two are

  • 0

I have a set up where I have three squares, the first two are set up to fade away when the third one is clicked. When you click it what happens though is the first two just disappear, no fading, I can’t really figure out why, any thoughts?

http://jsfiddle.net/6fSEz/

that’s the fiddle and this is the code by itself:

<html>
<head>
<style>
.box 
{     
    opacity:1;
    color: white;
    width: 100px;
    height: 100px;
} 

#box1
{
    background-color: green;
}

#box2
{
    background-color: red;
}

#box3
{
    background-color: blue;
}

.fadeAway1
{ 
    opacity:0;
    -webkit-transition-property: opacity; 
    -webkit-transition-duration: 2s; 
}  

.fadeAway2 
{ 
    opacity:0;
    -webkit-transition-property: opacity; 
    -webkit-transition-duration: 5s; 
}  
</style>
</head>

<body>
<div id="box1" class="box"></div>
<div id="box2" class="box"></div>
<div id="box3" onclick="box2.className='fadeway1';box1.className='fadeaway2';"   
class="box">Tap to fade</div>



</body>
</html>

Thanks in advance for any help.

  • 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-31T00:03:05+00:00Added an answer on May 31, 2026 at 12:03 am

    In the click function you are removing the styles applied by the “.box” class styles. This removes the width and height, etc. Also, CSS and JavaScript are case-sensitive. Capitalization between selectors must match the element attributes, exactly.

    Updated jsfiddle: jsfiddle.net/6fSEz/2/

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

Sidebar

Related Questions

I have a three tier set-up. Someone suggested I should get the ConnectionString from
I have a table that has three different date columns, so I set each
I'm using Google Test Framework to set some unit tests. I have got three
Firstly, let me set out what I'd like to do. Assume I have three
I have a set of unique elements (there are not two identical elements). And
I have two sets of three (non-collinear) points, in three dimensions. I know the
For example, I have set of geometrical figures: Set<Figure> figures; There are two types
I have a set of tree objects with a depth somewhere in the 20s.
Is there a way that you can have SERVEROUTPUT set to ON in sqlplus
I have a set of base filenames, for each name 'f' there are exactly

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.