I’ve successfully gotten my menu to be sticky using jQuery waypoints in this jsFiddle. It works fine in the fiddle, but when I implement on my test drupal site, it’s no longer active.
Here’s the markup:
<?php if ($page['main_menu']): ?>
<div id="stickywrapper">
<div class="main-menu-wrapper">
<div class="main-menu-wrapper-inner <?php echo $grid_size ?>">
<nav id="main-menu" class="<?php echo $grid_full_width ?> clearfix">
<?php print render($page['search_box']); ?>
<?php print render($page['main_menu']); ?>
</nav>
</div><!--end main-menu-wrapper-inner-->
</div><!--end main-menu-wrapper-->
</div><!--end stickywrapper-->
<?php endif; ?>
You’ve got a stray Unicode zero width space (U+200B) character at the end of the JavaScript code in
stickymenu.js, causing a syntax error. Delete that and it all works out.