I'm trying to use the following two css classes to show/hide elements with transition effects-
.hidden{
opacity: 0;
height: 0;
overflow: hidden;
visibility: hidden;
transition: all 2s;
}
.shown{
opacity: 1;
visibility: visible;
height: auto;
transition: all 2s;
}
//JS code to toggle classes -
$("#cancelLogin").click(function(){
$('form.login').toggleClass("shown").toggleClass("hidden");
$('.circles').toggleClass("concealed").toggleClass("shown");
});
.shown works fine, but no transition happening while adding .hidden class. Any idea?
hiddenclass.concealedis being added but it has no properties defined.