jQuery toggle animation
$(‘.login’).toggle( function(){ $(‘#panel’).animate({ height: “150”, padding:”20px 0″, backgroundColor:’#000000′, opacity:.8 }, 500); $(‘#otherdiv’).animate({ //otherdiv properties here }, 500); }, function(){ $(‘#panel’).animate({ height: “0”, padding:”0px 0″, opacity:.2 }, 500); $(‘#otherdiv’).animate({ //otherdiv properties here }, 500); });