How to use CSS3 transitions

css, html, javascript, jquery

Solution

The property `display` that assign the method `toggle ()` can't be animated with the CSS transitions. Maybe you want to look at `fadeIn()` and `fadeOut()`.

Edit

I've found this another method fadeToggle() i don't know much about it but you can search and use this:

$('.back-fade').click(function(){
  $('#welcome-content').fadeToggle(2000);
  $('#configure-content').fadeToggle(2000);        
});

Check this demo http://jsfiddle.net/8urRp/14/ *

*I made the divs with absolute position to keep them on the same space

Problem

I have the following HTML: ``` <div id="welcome-content"> // Code </div> <div id="configure-content" style="display:none"> // Code </div> ``` And (working) jquery that toggles between them: ``` $('.back-welcome').click(function(){ $('#welcome-content').toggle(); $('#configure-content').toggle(); }); ``` I want to use CSS3 to create a fade effect as I toggle between them. I have tried the following: ``` #welcome-content, #configure-content{ -webkit-transition: all 400ms; -o-transition: all 400ms; -moz-transition: all 400ms; -ms-transition: all 400ms; -khtml-transition: all 400ms; } ``` However, no animation takes place. What am I doing wrong?

Original source

Related problems