You are here

function om_maximenu_scroll in OM Maximenu 8

Same name and namespace in other branches
  1. 6 inc/om_maximenu.effects.inc \om_maximenu_scroll()
  2. 7 inc/om_maximenu.effects.inc \om_maximenu_scroll()

Animated floating menu

1 call to om_maximenu_scroll()
om_maximenu_asset_loader in inc/om_maximenu.render.inc
Loads styles and js

File

inc/om_maximenu.effects.inc, line 425
OM Maximenu Effects

Code

function om_maximenu_scroll($menu = NULL) {
  $scroll_float_js = "\n    jQuery(document).ready(function(\$){ \n      var topYloc = null;\n\n      \$(window).scroll(function () { \n\t      var scrollTop = \$(document).scrollTop();\n\t      scrollTop = parseInt(scrollTop);\n\t\n\t      var offset = topYloc+scrollTop+'px';  \n\t      \$('#om-maximenu-" . $menu . "').animate({top:offset},{duration:500,queue:false});\n      });\n\n\t    topYloc = parseInt(\$('#om-maximenu-" . $menu . "').css('top').substring(0,\$('#om-maximenu-" . $menu . "').css('top').indexOf('px')));\n    });";
  drupal_add_js($scroll_float_js, "inline");
}