Created
August 28, 2024 11:20
-
-
Save Crocoblock/0fb997e7b62d8eef198b957eb0d21830 to your computer and use it in GitHub Desktop.
JavaScript code to add overlay functionality to mega menu items on a web page. When you hover over each menu item, an overlay is displayed behind it, providing a lightbox effect
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
.overlay { | |
position: fixed; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
background: rgba(0, 0, 0, 0.7); | |
display: none; | |
z-index: -1; | |
pointer-events: none; | |
} | |
.jet-mega-menu-item-has-children.jet-mega-menu-item--hover .overlay { | |
display: block; | |
z-index: 998; | |
} | |
.jet-mega-menu-item--hover .jet-mega-menu-mega-container, .jet-mega-menu-item--hover .jet-mega-menu-item__inner { | |
position: relative; | |
z-index: 999; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment