带有SlickNav的Skrollr,重叠问题

时间:2015-07-23 02:08:35

标签: javascript html css skrollr slicknav

我使用Skrollr修复了图像,就像这样:http://prinzhorn.github.io/skrollr/examples/classic.html

我也在使用Slicknav作为菜单。不幸的是,当菜单打开时,它会在Fixed" parallax"后面打开。图片。

我尝试过更改定位,边距,z-index,Blah!无济于事。我想在菜单上打开图片。

编辑:这里有一些代码: 此菜单放置在div中,类为" section-1"在skrollr-body内部

<ul id="menu">
    <li><a href="#">About</a></li>
    <li><a href="#">Services</a></li>
    <li><a href="#">Staff</a></li>
    <li><a href="https://goo.gl/maps/YPs83">Map</a></li>
    <li><a href="#">Contact</a></li>
   </ul>```

之后的图像位于skrollr-body之外:

<div
    class="parallax-image-wrapper parallax-image-wrapper-100"
    data-anchor-target="#section-1 + .gap"
    data-bottom-top="transform:translate3d(0px, 200%, 0px)"
    data-top-bottom="transform:translate3d(0px, 0%, 0px)">

    <div
        class="parallax-image parallax-image-100"
        style="background-image:url(assets/images/back_sun.jpg)"
        data-anchor-target="#section-1 + .gap"
        data-bottom-top="transform: translate3d(0px, -80%, 0px);"
        data-top-bottom="transform: translate3d(0px, 80%, 0px);"
    ></div>

css:

                /*--------------- 
                    Slick-NAV
                */---------------

                /* Button */
                .slicknav_btn {
                    background: none;
                }
                /* Button Lines */
                .slicknav_menu .slicknav_icon-bar {
                  background-color: #FFF2E8;
                }
                .slicknav_menu {
                    background:#212b41;
                    padding:0;
                }
                .slicknav_nav ul, .slicknav_nav li {
                    border-top:2px solid #9FBDD1;
                    margin-top:0;
                    margin-right:0;
                    margin-bottom:0;
                }
                .slicknav_nav .slicknav_item:hover {
                    background:none;
                    color: #FFF2E8;
                }
                .slicknav_nav a {
                    color: #FFF2E8;
                }

                .slicknav_nav a:hover{
                    background:none;
                    color:#FFF2E8;
                }
                .slicknav_nav .slicknav_txtnode {
                    padding: 7px 15px;
                    margin: 0;
                }
                a.slicknav_btn.slicknav_collapsed, a.slicknav_btn.slicknav_open {
                  background-color: transparent;
                }

                .slicknav_menu .slicknav_menutxt, .slicknav_brand a, .slicknav_brand {
                  color: #FFF2E8;
                  font-family: 'Codystar', cursive;
                  font-weight: normal;
                  text-shadow: 0 0px 0px #000;
                }
                /*--------------- 
                    Skrollr
                */---------------
                html, body {
                        height:100%;
                }
                .skrollr-desktop body {
                    height:100% !important;
                }
                body {
                    font-family:sans-serif;
                }
                p {
                    margin:0 0;
                }
                .parallax-image-wrapper {
                    position:fixed;
                    left:0;
                    width:100%;
                    overflow:hidden;
                }
                .parallax-image-wrapper-50 {
                    height:50%;
                    top:-50%;
                }
                .parallax-image-wrapper-100 {
                    height:100%;
                    top:-100%;
                }
                .parallax-image {
                    display:none;
                    position:absolute;
                    bottom:0;
                    left:0;
                    width:100%;
                    background-repeat:no-repeat;
                    background-position:center;
                    background-size:cover;
                }
                .parallax-image-50 {
                    height:200%;
                    top:-50%;
                }
                .parallax-image-100 {
                    height:100%;
                    top:0;
                }
                .parallax-image.skrollable-between {
                    display:block;
                }
                .no-skrollr .parallax-image-wrapper {
                    display:none !important;
                }
                #skrollr-body {
                    height:100%;
                    overflow:visible;
                    position:relative;
                }
                .gap {
                    background:transparent center no-repeat;
                    background-size:cover;
                }
                .skrollr .gap {
                    background:transparent !important;
                }
                .gap-50 {
                    height:50%;
                }
                .gap-75 {
                    height:75%;
                }
                .gap-100 {
                    height:100%;
                }
                .header, .content {
                    background:#eee;
                    -webkit-box-sizing:border-box;
                    -moz-box-sizing:border-box;
                    box-sizing:border-box;
                }
                .content-full {
                    height:100%;
                }
                #done {
                    height:100%;
                }

有人有什么想法吗?

谢谢!

1 个答案:

答案 0 :(得分:2)

回答了我自己的问题!

给了.slicknav_menu

    position: relative;
    z-index: 10;

不幸的是,非固定内容也会滑动,但我可以搞清楚!