Created
August 6, 2014 10:48
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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