<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#hiddenBlock{
display: none;
opacity: 0;
transition: all .25s linear;
}
</style>
</head>
<body>
<div id="hiddenBlock">
<p>Рандомное наполнение</p>
</div>
<button onclick="showBlock()" id="trigerShowButton">Показать блок</button>
<button onclick="hideBlock()" id="trigerHideButton">Скрыть блок</button>
<script type="text/javascript">
var block = document.getElementById('hiddenBlock');
function showBlock() {
document.getElementById('trigerShowButton').disabled = true;
block.style.display = 'flex';
setTimeout(opacity, 2);
}
function hideBlock() {
document.getElementById('trigerHideButton').disabled = true;
block.style.opacity = '0';
setTimeout(display, 250);
}
function display(){
block.style.display = 'none';
document.getElementById('trigerHideButton').disabled = false;
}
function opacity(){
block.style.opacity = '1';
document.getElementById('trigerShowButton').disabled = false;
}
</script>
</body>
</html>