0

I am using a bootstrap one page template. I have everything all squared away except that I have a menu button (when clicked exposes sidebar menu) and it works only one time. To make it work again I have to reload page. It's kind of weird because it seemed to be working fine at first, but now it doesn't. The only thing I can think of is something in the routes.rb? I will post my _navbar partial to see if I am missing something there.

Does anybody know how to make the navbar stay loaded? It's a one page site so it is basically just linking to partial on page.

Thank you for any help, I will continue to research this, but so far no luck. Btw I am using stylish portfolio theme.

<a id="menu-toggle" href="#" class="btn btn-dark btn-lg toggle"><i class="fa fa-bars"></i></a>
<nav id="sidebar-wrapper">
<ul class="sidebar-nav">
    <a id="menu-close" href="#" class="btn btn-light btn-lg pull-right toggle"><i class="fa fa-times"></i></a>
    <li class="sidebar-brand">
        <a href="#top"  onclick = $("#menu-close").click(); >PCC</a>
    </li>
    <li>
        <a href="#top" onclick = $("#menu-close").click(); >Home</a>
    </li>
    <li>
        <a href="#about" onclick = $("#menu-close").click(); >About</a>
    </li>
    <li>
        <a href="#services" onclick = $("#menu-close").click(); >Vision</a>
    </li>
    <li>
        <a href="#portfolio" onclick = $("#menu-close").click(); >History</a>
    </li>
    <li>
        <a href="#contact" onclick = $("#menu-close").click(); >Contact</a>
    </li>
</ul>
</nav>
  • sounds like it may be a turbolinks issue http://stackoverflow.com/questions/36110789/rails-5-how-to-use-document-ready-with-turbo-links – Ian Kenney Feb 24 '17 at 03:30
  • include the relevant JavaScript code for showing and hiding the button and specify if the function declarations are inside a `$(document).ready()` block or something similar – ScieCode Feb 24 '17 at 11:31
  • thanks for the help – KornDogg420 Feb 24 '17 at 19:58

0 Answers0