Disable Fixed Top Menu

February 2014 Joomla Template
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Aug 26, 2014 7:53 am
Reply with quote
Report this post
Hi, how do I disable the fixed top menu and make it just stay up top when scrolled down?

Thanks in advance.
User avatar
Fresh Boarder

GK User
Tue Aug 26, 2014 11:09 pm
Reply with quote
Report this post
Hello,

I don't know which version of Joomla are you using, but you should remove this kind of code fragment from js/gk.menu.js file:

Code: Select all
//
    // 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');
            }
        }
    });


(it is a code for Joomla 2.5, for Joomla 3.x it will be the same code but in jQuery).
User avatar
Administrator


cron