Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active December 1, 2015 16:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save neilgee/bdc6c5ac3a348323f3ee to your computer and use it in GitHub Desktop.
Save neilgee/bdc6c5ac3a348323f3ee to your computer and use it in GitHub Desktop.
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