在更新后,SideNav不能正常工作。

时间:2022-06-03 19:04:24

I recently updated the css/js files of the Materializecss design in my project from v0.97.5 to v0.97.8.

最近,我从v0.97.5到v0.97.8在我的项目中更新了Materializecss设计的css/js文件。

I thought it wouldn't make much of a difference but my SideNav is not working right anymore. When I click on the menu, it does slide out but the dark overlay is on the entire screen and I cannot click anything. This is what it looks like:

我认为这不会有什么大的差别,但我的SideNav已经不正常了。当我点击菜单时,它会滑出屏幕,但是阴影覆盖在整个屏幕上,我不能点击任何东西。这就是它的样子:

在更新后,SideNav不能正常工作。

It looks like the 'sidenav-overlay' div with the opacity is above the sideNav. Also, I cannot click on any menu inside this sideNav.

它看起来像“sideNav -overlay”,不透明度高于sideNav。而且,我不能点击这个sideNav里面的任何菜单。

The implementation of this is basically similar to what is mentioned in the documentation. I'm not sure what changed over here.

它的实现基本上与文档中提到的类似。我不确定这里发生了什么变化。

EDIT1: My code -

——EDIT1:我的代码

<div class="navbar-fixed">
  <nav>
    <div class="nav-wrapper light-blue lighten-1">
      <ul id="slide-out" class="side-nav hide-on-med-and-down print-hidden">
        <li><a href="#!">Upload<i class="material-icons right">cloud_upload</i></a></li>
        <li class="divider"></li>
        <li class="div-title">Admin</li>

        <li><a href="/admin/users">Users</a></li>
        <li><a href="/admin/roles">Roles</a></li>
      </ul>

      <a href="#" data-activates="slide-out" class="button-collapse show-on-large"><i class="material-icons">view_headline</i></a>

      <a href="#" class="brand-logo">LOGO</a>
    </div>
  </nav>
</div>

1 个解决方案

#1


1  

What fixed this was that my side-nav ul list was inside the navbar-fixed div. This wasn't an issue in the previous version but for some reason, this broke in the current 0.97.8 version.

修正的是我的侧导航ul列表是在navbar-fixed div中,这不是以前版本的问题,但出于某种原因,它在当前的0.97.8版本中崩溃了。

Just moving the side-nav outside the navbar section fixed this for me. Hopefully this helps someone else in the same situation.

只需要移动导航栏外的侧导航就可以了。希望这能帮助其他处于相同处境的人。

#1


1  

What fixed this was that my side-nav ul list was inside the navbar-fixed div. This wasn't an issue in the previous version but for some reason, this broke in the current 0.97.8 version.

修正的是我的侧导航ul列表是在navbar-fixed div中,这不是以前版本的问题,但出于某种原因,它在当前的0.97.8版本中崩溃了。

Just moving the side-nav outside the navbar section fixed this for me. Hopefully this helps someone else in the same situation.

只需要移动导航栏外的侧导航就可以了。希望这能帮助其他处于相同处境的人。