Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to close navigation bar when a menu item (in the nav bar) is clicked. #18

Closed
sankari123 opened this issue Sep 6, 2017 · 2 comments

Comments

@sankari123
Copy link

Thanks for your code.Very easy to follow. I have an issue. In the navigation bar ( where hand image is displayed) I have listed few menu items such as Home, Archives, Login and so on. When a menu is clicked, I want the navigation bar to close . But the navigation does not hide but expects the user to swipe. Pl help me

@JoanClaret
Copy link
Owner

JoanClaret commented Sep 6, 2017

Hi there, thanks for your comments

this is not an expected functionality, since normally the link you clicked inside the navigation bar will redirect to another page. there you'll find the navigation closed.

aside of this, you can close / open the navigation by calling the function slideAndSwipe
so maybe (as an easy solution) you can make something like this

<script>
  $(document).ready(function() {
    $('.your-nav-bar a').slideAndSwipe();
  });
</script>

like so, all links located in .your-nav-bar will close the navigation bar.
hope this solution fits with your needs.

cheers
J

@sankari123
Copy link
Author

Thanks for your quick reply. i'm sorry. but your solution s not working. I'm calling a javascript function which should perform 2 fns 1. close nav bar. 2. open login form in main screen.

Ass per this code (after adding class="ssm-toggle-nav",) the nav bar is closed but login function is not called.

      <ul>
          <li><a href="javascript: login();" class="ssm-toggle-nav">Login</a></li>
          <li><a href="#">Archives</a></li>
           <li><a href="#">Feedback</a></li>
      </ul>
     </nav>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants