6
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’t get it to start closed (without Collapse), that is, only after clicking it will appear and go down, and when clicking again, it will go back to the closed format. What I do?
Could put the HTML of the Panel and, if possible, the part
$(document).on('ready', function (){});
of your code?– Felipe Avelar
you can’t make a Jsfiddle?
– msm.oliveira
You can put a little more code?
– Amadeu Antunes