0
I made a dropdown menu with bootstrap, but I want that when this menu opens (it opens on top of the content of the page), the whole page is in an opaque effect. I tried to do something like this by fiddling with the background, but it didn’t look good on the images, I wanted like a darker layer over the whole page.
<header class="header">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Menu
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
</ul>
</div>
</div>
<main class="content">
</main>
<footer class="footer"><p>Copyrights</p></footer>
A transition in the created id=back div would create an interesting effect at the time of change.
– Bsalvo
@Brunocastro, I agree, but I do not know how to do... If you know, tell me how I put.
– Laércio Lopes
Some small changes would be necessary:
.dropdown { z-index: 10; }
,#back { opacity: 0; -webkit-transition: opacity ease-in-out 0.2s; transition: opacity ease-in-out 0.2s; }
. Then just change the JS to work with opacity difference 0 and 1; no display None and block.– Leon Freire
hello, thank you, but I wanted the content of the background to continue appearing, only with a darker base on top.
– Sabrina
@sabrinabgbc Content keeps popping up behind, just there is no content behind to be seen in his example.
– Leon Freire
Now there’s content... and it keeps popping up...
– Laércio Lopes
that’s right, thank you !
– Sabrina