Skip to content

Instantly share code, notes, and snippets.

@beppe9000
Created June 28, 2019 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beppe9000/23a91cbc1653df3b589e4cd25ad93593 to your computer and use it in GitHub Desktop.
Save beppe9000/23a91cbc1653df3b589e4cd25ad93593 to your computer and use it in GitHub Desktop.
JQUERY QUICK TARGETED OVERLAY
$("<div>&nbsp;</div>").css({ // https://stackoverflow.com/a/13755589/3389585
position: "absolute",
width: "100%",
height: "100%",
top: 0,
left: 0,
background: "#cccccc",
opacity:0.5
}).appendTo($("#target").css("position", "relative"));
@beppe9000
Copy link
Author

TODO:

Also might be a good idea to check if the .container has 'static' positioning before setting it's position... to make code reusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment