davist11/jQuery-One-Page-Nav

Link to act only as button

DanieleSassoli opened this issue · 2 comments

Hi, I have a list of links that refer to parts of my page, and it works perfectly, but then I would like to have the last element of my list to act just like a button, but it has to be a link because of styling issues.

    <ul class="menuzord-menu pull-right op-nav">
        <li class="active"><a href="#home">Home</a></li>
        <li><a href="#chi_siamo" translate>WHO_WE_ARE</a></li>
        <li><a href="#per_voi">Per Voi</a></li>
        <li><a href="#lavorazioni">Lavorazioni</a></li>
        <li><a href="#mastro">L'Argentiere</a></li>
        <li><a href="#forza_viola">Forza Viola</a></li>
        <li><a href="#news">News</a></li>
        <li><a href="#contact">Contact</a></li>
        <li>
            <a href="#" ng-click="changeLanguage()">Change Language</a>
        </li>
    </ul>

but when Iclick for the first time on this link I get "Cannot read property 'top' of undefined", and the changeLanguage function dosn't get called, so I have to ri-click on the button. How can I avoid this?
Thanks, and by the way you did a really good job!

Sounds like you need to filter out that item from the nav: https://github.com/davist11/jQuery-One-Page-Nav#filter-example

and that was it, sorry about this, I didn't understood this by reading the README, maybe writing a couple of extra lines on this could help avoiding this sort of issue or maybe it was pretty obvious and it was just me not paying enough attention, anyway great job, and thanks.