It is impossible to remove the scroll bar when the modal window is open, I tried using overflow-y:hidden with the addition of a function, but nothing happened. What should I do to remove the scroll bar in the modal window, well, actually to appear when you close it?
The code and everything is here. https://dropmefiles.com/48oP6 Password: NioD8D
Javascript:
$(document).ready(function() { setTimeout(popup, 3000); function popup() { $("#logindiv").css("display", "block"); } $("#login #cancel").click(function () { $(this).parent().parent().hide(); }); $("#onclick, #onclick1, #onclick2").click(function () { $("#contactdiv").css("display", "block"); }); $("#contact #cancel").click(function () { $(this).parent().parent().hide(); }); }); Styles:
#contactdiv{ z-index: 10; opacity:0.92; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; background: #000; display: none; } #logindiv{ opacity:0.92; position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; background: #000; display: none; }
.css("display", "block"), you can use.show(), and then there is no dark forest, it's not clear even which element needs to remove the scroll bar - MasterAlex