<div class="container bg-dark">
<div class="row">
<div class="col">
<button class="btn btn-primary my-4" id="showIB">Показать панель</button>
</div>
<div class="col">
<div class="card border-success mb-3 float-right" style="max-width: 18rem;" id="sampleCard">
<div class="card-header bg-transparent border-success">Header</div>
<div class="card-body text-success">
<h5 class="card-title">Success card title</h5>
<p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
</div>
<div class="card-footer bg-transparent border-success">Footer</div>
</div>
</div>
</div>
</div>
#sampleCard {
right: -130%;
display: none;
opacity: 0;
}
$(document).ready(function () {
$("#showIB").on("click", function (event) {
event.stopPropagation();
$("#sampleCard")
.animate({
right: 0,
opacity: 1
})
.css("display", "inline");
});
$("#sampleCard").on("click", function (event) {
event.stopPropagation();
});
});
$(document).on("click", function () {
$("#sampleCard").animate(
{
right: "-130%",
opacity: 0
},
{
complete: function () {
$(this).css("display", "none");
}
}
);
});
$(document).ready(function () {
$("#showIB").on("click", function (event) {
event.stopPropagation();
$("#sampleCard")
.animate({
right: 0,
opacity: 1
})
.css("display", "inline");
$('body').css("overflow","hidden");
});
$("#sampleCard").on("click", function (event) {
event.stopPropagation();
});
});
$(document).on("click", function () {
$("#sampleCard").animate(
{
right: "-130%",
opacity: 0
},
{
complete: function () {
$(this).css("display", "none");
}
}
);
$('body').css("overflow","auto");
});