Sam333
Sam333

Reputation: 341

Navigation menu not working on google chrome

I am admin of this page : iuvestudio.com My problem occured recently, till september 2017 everything was fine. Now however the navigation menu (top of the site and bottom of the site) is not working on my Google Chrome. If clicked, it just changes color but doesnt move you to right section. It works on Edge however. And maybe it just doesnt work on my Google Chrome but on others it does. I have no idea what should I do to make it work. Any ideas ? I will be very thankful for any suggestions. Thank you.

Upvotes: 0

Views: 2543

Answers (1)

Wouter Vandevelde
Wouter Vandevelde

Reputation: 904

There is an event listener added to your <a> elements in your plugins.js on line 59. Removing this event listener fixed the issue for me.

You can test it by opening the inspecter (f12) and selecting an <a> element in the header. Than open the "Event Listeners" tab and open up the click events. You now find "a plugins:59". Remove this listener and everything works again.

Edit:

I added event listeners for the a elements to scroll to the id. (I'm only adding these in chrome). The following code was added to your plugins.js file:

var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;

if (is_chrome) {
    var attributes = ['home', 'whatido', 'myworks', 'about', 'contact'];

    $.each(attributes, function( index, value ) {
        $('a[href="#' + value + '"]').click(function() {
            $('html, body').animate({
                scrollTop: $('#' + value).offset().top
            }, 1000);
        });
    });
}

Upvotes: 1

Related Questions