There is a piece of html code
<div class="header">тут контент <div class="load-panel" style="opacity:0">тут контент</div> </div> Wrote a code to open the block .load-panel
$("#load").on("click", function() { var id = $(this).data("id") , check = $(".header").attr("id"); if(check) { $(".load-panel").animate({ opacity: 0, "margin-top": 0, paddingTop: 0, paddingBottom: 0, }, 200, "linear", function() { $(".header").animate({ "min-height": 60 }).attr("id", ""); }); return false; } $(".header").animate({ "min-height": 400 }, 200, "linear", function() { $( this ).attr("id","open"); $(".load-panel").css({ "border-top": '1px solid' }).animate({ opacity: 1, "margin-top": 15, paddingTop: 30, paddingBottom: 30, borderColor: "#c0c0c0" }); }); }); How to solve the problem of multiple clicks on a link to open a block? If you click on an example 5 times by reference, the .header block returns to its original position, more precisely, its height is 60px, and the .load-panel block remains unclosed.
Maybe someone will help correct / improve the code for a more correct execution of the task?