Created
July 24, 2020 11:07
-
-
Save WebDevJL/5ec4a35ad373dc263e142313d4479ea9 to your computer and use it in GitHub Desktop.
Divi builder slide menu
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
jQuery(document).ready(function(){ | |
var mobileNav = jQuery(".mobile_nav"); | |
var mobileMenuBar = jQuery(".mobile_menu_bar"); | |
jQuery(".et_mobile_menu") | |
.append("<li><a class=\"close-nav\" href=\"#\" aria-label=\"Fermer le menu\" title=\"Fermer le menu\">Fermer le menu</a></li>"); | |
mobileMenuBar.click(function(event) { | |
var openedMenu = mobileNav.hasClass("opened"); | |
console.log("clicked menu icon (opened: "+openedMenu+"!"); | |
}); | |
jQuery(".close-nav").click(function(event) { | |
var openedMenu = mobileNav.hasClass("opened"); | |
console.log("clicked close nav link (opened: "+openedMenu+"!"); | |
mobileMenuBar.removeClass("opened"); | |
}); | |
}); |
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
/* | |
* Slide menu | |
* TODO: add a close link | |
* */ | |
.et_mobile_menu, | |
.closed .et_mobile_menu { | |
position: fixed; | |
z-index: 9999; | |
width: 100%; | |
top: 0 !important; | |
bottom: 0; | |
right: 0; | |
left: 1000%; | |
transform: translateX(0) !important; | |
transition: transform 250ms; | |
display: flex !important; | |
flex-direction: column; | |
align-items: center; | |
} | |
.opened .et_mobile_menu { | |
transform: translateX(-1000%) !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or look here: https://www.needyesterday.com/8-new-style-mobile-menu-divi/