Created
August 19, 2014 11:48
-
-
Save majuric/3c5ac56f1afc633a2f4a to your computer and use it in GitHub Desktop.
Disable elements on the page from being clicked by putting a transparent overflow
This file contains hidden or 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
// The point of this trick is to put a transparent overflow over the part of the page | |
// and fully prevent elements on the page from being clicked while not changing their | |
// appearance in any way. Effectivelly when someone tries to click on an element | |
// this transparent surface is being clicked. | |
.disableSelect { | |
/* Display it on the layer with index 1001. | |
Make sure this is the highest z-index value | |
used by layers on that page */ | |
z-index:1001; | |
/* make it cover the whole screen */ | |
position: absolute; | |
top: 0%; | |
left: 0%; | |
width: 100%; | |
height: 100%; | |
/* make it white but fully transparent */ | |
background-color: white; | |
opacity:.00; | |
filter: alpha(opacity=00); | |
} | |
// Place an empty div with the class of 'disableSelect' inside the element you want to overflow | |
<html> | |
<head> </head> | |
<body> | |
<div class="disableSelect"> </div> // This will disable clicking any element on the whole page. | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment