Link to external page does not work

0

In the www.wrccdesign.com.br menu, the BLOG link, which is a external link that should lead to another page, does not work, ie when clicking nothing happens. I would like to know how to solve the problem. I did some testing, and from what I noticed a JS is affecting functionality.

    
asked by anonymous 26.10.2016 / 10:38

1 answer

0

This function is blocking:

$('.templatemo-top-menu .navbar-nav a').click(function(e){
    e.preventDefault(); 
    var linkId = $(this).attr('href');
    scrollTo(linkId);
    if($('.navbar-toggle').is(":visible") == true){
        $('.navbar-collapse').collapse('toggle');
    }
    $(this).blur();
    return false;
});

Note, when you use e.preventDefault(); it prevents the click event from being continued. You have several ways to solve this problem, I think it would be best to specify the links you want to call this function, like this:

Add the class inpage to all the menus that scroll on the page:

<a href="#templatemo-about" class="inpage">SOBRE</a>

Those who will open externally leave you as is:

<a href="http://www.wrccdesign.com.br/blog/" target="_blank">BLOG</a>

And then add an .inpage to the end of the selector of your function:

$('.templatemo-top-menu .navbar-nav a.inpage')
    
26.10.2016 / 12:45