Skip to content

Instantly share code, notes, and snippets.

@pixelite
Last active December 24, 2015 02:49
Show Gist options
  • Save pixelite/6733049 to your computer and use it in GitHub Desktop.
Save pixelite/6733049 to your computer and use it in GitHub Desktop.
#navigation #main-menu li {
-webkit-border-radius: 7px
-moz-border-radius: 7px;
border-radius: 7px;
background: green;
box-sizing: border-box;
width: 45%;
float: left;
margin: 5px;
padding: 10px 0;
text-align: center;
}
(function ($, Drupal, window, document, undefined) {
Drupal.behaviors.toggleMenu = {
attach: function(context) {
// $("#navigation #main-menu").tinyNav();
var menu_toggle = $('<div class="menu-toggle" />');
$("#navigation").prepend(menu_toggle);
$("#navigation .menu-toggle").click(function() {
$("#navigation #main-menu").slideToggle();
});
$(window).resize(function() {
if ($(this).width() < 480) {
$('#navigation #main-menu').hide();
}
else {
$('#navigation #main-menu').show();
}
});
}
}
}) (jQuery, Drupal, this, this.document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment