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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:24:08+00:00 2026-06-09T11:24:08+00:00

I’ve been fighting with this for a while now. I’ve declared the following styles.

  • 0

I’ve been fighting with this for a while now. I’ve declared the following styles.

div.contentItem{
  -webkit-transition: opacity 1.0s ease;
  display: block; // this line will be discussed below
}

div.contentItemHidden{
  opacity: 0;
}

div.contentItemVisible{
  opacity: 1;
}

And it works as supposed to except for a small, tiny issue. The different divs with contents appear below eachother. One can’t really see the other divs because of the opacity set to 0 in style contentItemHidden, but they still occupy the space.

Now, i know what you spontaneously want to suggest. “Use display: none, dummy!” on the line you’re discussing above. But guess what! If i make that change, the opacity transition doesn’t have effect at all – nothing appears on the screen.

Now, i know what you spontaneously will say now. “Put display: block, friend!” in the contentItemVisible style. But guess what! If i make that change, the opacity transition doesn’t have effect at all – the div appears kaboom instead of fading in.

I’m pretty sure that the missing transition has to do with the fact that the element is display: none. So i tried to modify my jQuery code so that right before i swap the classes (contentItemVisible and contentItemHidden), i add block’ification to the display like this.

$("#bzzz")
  .css("display", "block")
  .removeClass("contentItemHidden")
  .addClass("contentItemVisible");

Still, that has not the desired effect. If i don’t remove it later by .css(“display”, “none”) i get the weird placement (since the elements take up space, even though they can’t be seen). If i do remove it, we get no transition for opacity.

What am i doing wrong? What can i do instead?

A working jsFiddle of what i’m trying to achieve can be seen here (accept that i want to start with invisible DIV’s, of course). By changing the style to none for div.contentItem, the transition for opacity is voided.

  • 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-09T11:24:12+00:00Added an answer on June 9, 2026 at 11:24 am

    We’ve got a lot of great suggestions here but in the conclusion, i don’t believe that the tip i received elsewhere about solving the situation using CSS transition was good. I’ve used .fadeIn() and .fadeOut() in JS and that made it work. Nevertheless, some valuable info here.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.