Skip to content

Instantly share code, notes, and snippets.

@beppe9000
Created June 28, 2019 16:12
Show Gist options
  • Select an option

  • Save beppe9000/23a91cbc1653df3b589e4cd25ad93593 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown
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