Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Jquery fade/toggle only works on first click… Re: Jquery fade/toggle only works on first click…

#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();