When you first run the program and click anywhere on the body, it activates the collapse element. I want it to only collapse the accordion on click, not show it immediately. Currently, it will deactivate only after it is hidden once.
HTML
<!DOCTYPE html>
<html>
<body>
<div class="accordion" style="z-index:9999">
<div class="panel contact-panel">
<div class="panel-heading accordion-toggle collapsed" role="tab" id="headingTwo" data-toggle="collapse" data-parent="#accordion" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo" style="color:#fff!important;"> <span><h5 style="margin-bottom:0!important;"><i class="fa fa-envelope"> </i>Your Title here</h5></span>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body">
<form class="form-horizontal" role="form" method="post" action="" id="contactForm" name="contactForm">
<div class="form-group">
<label for="name" class="col-sm-3 control-label">Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="name" name="name" placeholder="First & Last Name" value="" />
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label">Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="email" name="email" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="91f4e9f0fce1fdf4d1f5fefcf0f8ffbff2fefc">[email protected]</a>" value="" />
</div>
</div>
<div class="form-group">
<label for="message" class="col-sm-3 control-label">Message</label>
<div class="col-sm-9">
<textarea class="form-control" rows="4" name="message" placeholder="Message Content Here"></textarea>
</div>
</div>
<div class="form-group">
<label for="human" class="col-sm-3 control-label">Are You <strong><u>Human</u>?</strong>
</label>
<div class="col-sm-9">
<input id="field_human" class="field_human" type="checkbox" name="human" />
</div>
</div>
<div class="form-group">
<div class="col-sm-9 col-sm-offset-3">
<button id="submit" name="submit" type="submit" class="btn btn-dark btn-block btn-lg">Send</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
CSS
.row > p{
padding:2%;
border:1px solid #eee;
border-radius:10px;
background:#eee;
}
.accordion {
width:100%;
position:fixed;
bottom:-2.1%;
margin-bottom:0;
padding-bottom:0;
}
.accordion label {
color:#fff;
}
.accordion input {
border-radius:0;
}
.panel-heading, .panel-heading:hover, .panel-heading:focus, .panel-heading.focus, .panel-heading:active, .panel-heading.active {
cursor:pointer;
background-color: #c9302c;
border-color: #ac2925;
outline:none;
}
.accordion-toggle {
text-align:center;
}
...... (remaining CSS code)
JavaScript
// This section contains the JavaScript code logic that operates the functionality of the accordion component.
// If needed, add some unique description or notes about this part of the code.
...... (add more unique content)