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

side-nav links doesn't works in fixed navbar #3982

Closed
miguelkashir opened this issue Dec 7, 2016 · 6 comments
Closed

side-nav links doesn't works in fixed navbar #3982

miguelkashir opened this issue Dec 7, 2016 · 6 comments

Comments

@miguelkashir
Copy link

miguelkashir commented Dec 7, 2016

I have a navbar with brand logo at left and links at right, and the sidenav function works perfect.
I tried to make the navbar fixed, but now the sidenav links doesn't works (the sidenav appears in grey color)

Code

  <div class="navbar-fixed">
    <nav class="green">
      <div class="nav-wrapper">
        <a href="/" class="brand-logo">
          <i class="material-icons">shopping_basket</i>
          macromeal
        </a>
        <a href="#" data-activates="mobile-demo" class="button-collapse">
          <i class="material-icons">menu</i>
        </a>
        <ul class="right hide-on-med-and-down">
          <%= render 'layouts/links' %>
        </ul>
        <ul class="side-nav" id="mobile-demo">
          <%= render 'layouts/links' %>
        </ul>
      </div>
    </nav>
  </div>

Screenshot
image

@simonsmh
Copy link

simonsmh commented Dec 8, 2016

Yes same problem.

@Thanood
Copy link

Thanood commented Dec 8, 2016

Please try moving the side-nav out of the navbar structure. Like this:

  <div class="navbar-fixed">
    <nav class="green">
      <div class="nav-wrapper">
        <a href="/" class="brand-logo">
          <i class="material-icons">shopping_basket</i>
          macromeal
        </a>
        <a href="#" data-activates="mobile-demo" class="button-collapse">
          <i class="material-icons">menu</i>
        </a>
        <ul class="right hide-on-med-and-down">
          <%= render 'layouts/links' %>
        </ul>
      </div>
    </nav>
  </div>
  <ul class="side-nav" id="mobile-demo">
    <%= render 'layouts/links' %>
  </ul>

Not exactly sure but in principle this works. 😃

@simonsmh
Copy link

simonsmh commented Dec 8, 2016 via email

@tomscholz
Copy link
Contributor

Duplicate #3844

@miguelkashir
Copy link
Author

miguelkashir commented Dec 9, 2016

Thanks @Thanood ! I will try it.
Btw, I already fixed it by this way:

function initialize() {
  $('.button-collapse').sideNav();
  $('.button-collapse').click(removeOverlay);
}

function removeOverlay() {
  $('div[id^=sidenav-overlay]').remove();
}

Oops, sorry @tomscholz . I searched but I didn't find it

@tomscholz
Copy link
Contributor

These issues are all duplicates:
#1664
#3918
#4046
#4231
#437
#4318
#3982
#2879
#4187

For the future discussion, please use this issue instead.
#3844

Repository owner locked and limited conversation to collaborators Sep 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants