I have the following panel:
$(document).on('click', '.panel-heading', function(e){
var $this = $(this);
if(!$this.hasClass('panel-collapsed')) {
$this.parents('.panel').find('.panel-body').slideUp();
$this.addClass('panel-collapsed');
$this.find('i').removeClass('glyphicon-menu-up').addClass('glyphicon-menu-down');
} else {
$this.parents('.panel').find('.panel-body').slideDown();
$this.removeClass('panel-collapsed');
$this.find('i').removeClass('glyphicon-menu-down').addClass('glyphicon-menu-up');
$('html, body').animate({scrollTop: $(".btn-modal").offset().top}, 1000);
}
});
My question is: I can not get it to start closed (without collapse), that is, only after clicking it will it appear and go down, and clicking again will return to the closed format. What do I do?