带有粘性导航的全宽子菜单

时间:2015-01-13 18:45:18

标签: javascript drop-down-menu submenu sticky

我尝试将子菜单合并到一个粘性导航中,该导航在下拉列表中显示全宽。现在我只能让子菜单显示父元素的宽度,而不是像导航菜单那样显示整个宽度。我本质上是在尝试创建此网站上使用的菜单功能:http://munchies.vice.com/en

我在" watch"下面有一个占位符下拉列表。我的网站部分(此处:http://interactive.wttw.com/foodphiles)正在使用此功能显示下拉列表:

<script>
    $(document).ready(
      /* This is the function that will get executed after the DOM is fully loaded */
      function () {
        /* Next part of code handles hovering effect and submenu appearing */
        $('.navElement').hover(
          function () { //appearing on hover
            $('.submenu', this).fadeIn();
          },
          function () { //disappearing on hover
            $('.submenu', this).fadeOut();
          }
        );
      }
    );
</script>

将子菜单移出包含div以使其显示100%(基于导航宽度)仅适用于显示全宽但打破其他所有内容的情况。谢谢你的帮助。

0 个答案:

没有答案
相关问题