Answers for "how to disable background when popup open in javascript"

0

how to disable background when popup open in javascript

#modal {
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  border:solid 1px #000;
  display:none;
  background-color:#fff;
}

#overlay {
  position:fixed;
  left:0;
  top:0;
  width:100vw;
  height:100vh;
  display:none;
  background-color:#000;
  opacity:0.5;
}
Posted by: Guest on October-28-2021
0

how to disable background when popup open in javascript

function openModal() {
  $("#overlay").css({"display":"block"});
  $("#modal").css({"display":"block"});
}
Posted by: Guest on October-28-2021

Code answers related to "how to disable background when popup open in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language