Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MeanMenu Genesis
<?php
//do not copy the opening php tag
//Load MeanMenu Mobile Menu
function meanmenu_load_scripts() {
wp_enqueue_script( 'meanmenu', get_stylesheet_directory_uri() . '/js/jquery.meanmenu.min.js', array( 'jquery' ), '2.0.8', true );
wp_enqueue_style( 'meanmenucss',get_stylesheet_directory_uri() .'/css/meanmenu.min.css', '', '2.0.8', 'all' );
}
add_action( 'wp_enqueue_scripts', 'meanmenu_load_scripts' );
function meanmenu_load_scripts_init() {
echo ' <script>jQuery(document).ready(function () {
jQuery("header nav").meanmenu({
meanScreenWidth: "480",
meanMenuContainer: "body",
meanMenuClose: "X",
meanMenuCloseSize: "18px",
meanMenuOpen: "<span /><span /><span />",
meanRevealPosition: "right",
meanRevealPositionDistance: "0",
meanRevealColour: "",
meanNavPush: "",
meanShowChildren: true,
meanExpand: "+",
meanContract: "-",
meanRemoveAttrs: false,
onePage: false,
removeElements: "",
meanDisplay: "block"
});
});</script>
';
}
add_action( 'wp_footer', 'meanmenu_load_scripts_init', 20 );
@media only screen and (max-width: 800px) {
/* # Mean Menu
-------------------------------------------- */
.mean-nav .genesis-nav-menu {
line-height: 1.6;
}
.mean-nav .genesis-nav-menu .menu-item:hover {
position: relative;
}
.mean-nav .genesis-nav-menu .sub-menu {
width: 100%;
position: relative;
left: 0;
opacity: 1;
}
.mean-nav .sub-menu a {
background-color: transparent;
font-size: inherit;
border-top: 1px solid rgba(255,255,255,.25);
border-bottom: none;
border-left: none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.