Home › Forums › JavaScript › Jquery fade/toggle only works on first click… › Re: Jquery fade/toggle only works on first click…
July 15, 2011 at 3:07 pm
#83450
Mottie
Member
Ok, try this (demo):
$(".btn-slide").click(function() {
if ( !$('#info').is(':hidden') ) {
$('#info').fadeOut(1000);
}
$("#panel").slideToggle(1000, function(){
if (!$(this).is(':hidden')) {
$(this).fadeIn(1500);
}
});
$(this).toggleClass("active");
return false;
});
$('#panel,#info').hide();