Hi, how do I disable the fixed top menu and make it just stay up top when scrolled down?
Thanks in advance.
//
// fixed menu
//
// create container for the fixed menu
var menuWrap = new Element('div', {'id': 'gkFixedMenu'});
menuWrap.set('html', '<div class="gkPage"></div>');
menuWrap.inject(document.body, 'bottom');
var menupos = document.id('gkTopNav').getCoordinates().top + 80;
var menucontent = document.id('gkTopNav');
var logo = document.id('gkLogo');
if(logo) {
logo.clone(true).setProperty('id', 'gkLogoSmall').inject(menuWrap.getElement('div'), 'top');
}
window.addEvent('scroll', function() {
var currentPosition = window.getScroll().y;
if(currentPosition > menupos && !menuWrap.hasClass('active')) {
menuWrap.addClass('active');
menucontent.inject(menuWrap.getElement('div'), 'bottom');
} else if(currentPosition < menupos && menuWrap.hasClass('active')) {
menuWrap.removeClass('active');
if(document.id('gkToolbar')) {
menucontent.inject(document.id('gkToolbar'), 'before');
} else {
menucontent.inject(document.id('gkTopBar'), 'bottom');
}
}
});