Link does not work when clicked

1

I have this code from a menu and when clicking on the item Biography the link does not work:

<ul id="ul-menu">
 <li class="li-menu"><a class="scroll" href="http://www.iracemafilha.com">HOME</a></li>
 <li class="li-menu"><a class="scroll" href="http://www.iracemafilha.com/biografia">BIOGRAFIA</a></li>
 <li class="li-menu"><a class="scroll" href="#discografia">DISCOGRAFIA</a></li>
 <li class="li-menu"><a class="scroll" href="#fotos">FOTOS</a></li>
 <li class="li-menu"><a class="scroll" href="#videos">VIDEOS</a></li>
 <li class="li-menu"><a class="scroll" href="#agenda">AGENDA</a></li>
 <li class="li-menu"><a class="scroll" href="#convite">CONVITE</a></li>
 <li class="li-menu"><a class="scroll" href="#contato">CONTATO</a></li>
</ul>

CSS Code:

#ul-menu {
   text-align: center;
   padding-top: 25px;
   word-spacing: 50px;
}

.li-menu {
    display: inline;    
    font-family: 'Abel', sans-serif;
 }

.li-menu a {
    color: white;
    text-decoration: none;
    font-size: 15px;
    background: #483D45;
    -moz-transition: all 0.2s linear;
    -webkit-transition: all 0.2s linear;
    -o-transition: all 0.2s linear;
    transition: all 0.2s linear;
}

I have already put the link target in "href" but when I click it it will not.

    
asked by anonymous 04.06.2015 / 15:24

1 answer

3

On the% of the page, there is a script:

jQuery(document).ready(function($) { 
    $(".scroll").click(function(event){        
        event.preventDefault();
        $('html,body').animate({scrollTop:$(this.hash).offset().top}, 200);
    });
});

Your link has class <head> , so it's triggering the configured event on scroll . The $(".scroll").click method stops link navigation. To fix, remove the event.preventDefault() or remove the preventDefault class from the link.

In addition, the script is giving the following error:

  

Uncaught TypeError: Can not read property 'top' of null

    
04.06.2015 / 16:16