<div style="background-color:grey">
</div>
Is there an easy way to do it?
Set the DIV's z-index to one larger than the other DIVs. You'll also need to make sure the DIV has a position other than static set on it, too. position relative and z index set to 999999999999999999999999999999999999999999999999999. in chrome.
It's a simple trick, you need to add the maximum value of z-index which is (z-index: 2147483647;) in to the overlay element. That trick will solve your issue.
Firstly, you will want to drag a Container Element onto your page. From the right-hand menu of the editor, you will notice that there is a "Full Width" toggle. Toggling this will set this Container Element to full width on your page.
Using CSS position property: The position: absolute; property is used to position any element at the absolute position and this property can be used to stack elements on top of each other. Using this, any element can be positioned anywhere regardless of the position of other elements.
Define a style overlay
or something like so:
<style>
.overlay {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
z-index:1000;
}
</style>
Then you can add the new class like this using jQuery:
$('#myDiv').addClass('overlay');
If you want to add with a click event you would do something like this:
$('a').click(function(){
$('#myDiv').addClass('overlay');
}
Or, you could add display:none
to the .overlay class so it's hidden on page load, then have your jQuery click
function show it like this:
$('a').click(function(){
$('.overlay').show('slow');
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With