Overlay code with CSS

Yepkoo

Yepkoo
Staff member
You can use the following CSS code to block any action on the site for the click of a button or for any other purpose.

CSS:
.overlay {
 /*display:none*/
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 2;
  cursor: pointer;
}

JavaScript:
 // To activate the CSS Code;
$("body").addClass("overlay")

// CSS Kodunu kapatmak için;
$("body").removeClass("overlay")
 
Top