Skip to content

Instantly share code, notes, and snippets.

@swapnilshrikhande
Created August 6, 2014 10:48
Show Gist options
  • Save swapnilshrikhande/9a6acb6fe3e817fb6461 to your computer and use it in GitHub Desktop.
Save swapnilshrikhande/9a6acb6fe3e817fb6461 to your computer and use it in GitHub Desktop.
Add blur blanket when a popup is opened, to disallow user to make any changes in parent window.
<style>
.aui-blanket {
background: #000;
height: 100%;
left: 0px;
opacity: 0.5;
position: fixed;
top: 0;
width: 100%;
z-index: 2500;
}
</style>
<body>
<div id="auiBlanketId" class="aui-blanket" tabindex="0" style="display:none;"></div>
</body>
window.blurScreen = function(){
var element = document.getElementById("auiBlanketId");
if(element)
element.setAttribute('style','');
}
//to reset
element.setAttribute('style','display:none;');
//in popup window
window.onload = function(){
window.opener.blurScreen();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment