html - 停止调整窗口大小的视差

标签 html css frontend parallax

我是前端新手,我正在尝试制作一个无法滚动的页面。我希望它是我的背景的大小。当我将我的手图像放在页面底部时,它会调整窗口大小。当手移动时,窗口滚动条甚至会自行滑动。如何确保大小固定?

html-

<!-- Page Content -->
<div class="container">
    <div class="row">
        <div class="wrapper">
            <ul id="scene">
                <li class="layer" id="bluelayer" data-depth="0.0"><img src="{%  static 'images/aboutus/BlueLayer.png' %}"></li>
                <li class="layer" id="booklayer" data-depth="0.0"><img src="{%  static 'images/aboutus/Book.png' %}"></li>
                <li class="layer" id="coffeelayer" data-depth="0.0"><img src="{%  static 'images/aboutus/Coffee.png' %}"></li>
                <li class="layer" id="handslayer" data-depth="0.6"><img src="{%  static 'images/aboutus/Hands.png' %}"></li>
                <li class="layer" id="keyboardlayer" data-depth="0.0"><img src="{%  static 'images/aboutus/Keyboard.png' %}"></li>
                <li class="layer" id="pencilonelayer" data-depth="0.0"><img src="{%  static 'images/aboutus/Pencil1.png' %}"></li>
                <li class="layer" id="penciltwolayer" data-depth="0.0"><img src="{%  static 'images/aboutus/Pencil2.png' %}"></li>
            </ul>
        </div>
    </div>
</div>

CSS-

body {
    margin-top: 0px;
    margin-bottom: 0px;
    background: none;
}

.full {
    background: url(../images/aboutus/Desk.jpg) no-repeat center center 
fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;

}


#bluelayer {
    margin-left: -9.5em;
    margin-top: -50px;
    width: auto;
    position: fixed;
    z-index: 3;
}

#booklayer {
    margin-left: -5em;
    margin-top: 350px;
    z-index: 1;
}

#coffeelayer {
    margin-top: 400px;
    margin-left: 80em;
    z-index: 1;
}

#handslayer {
    margin-top: 400px;
    margin-left: 25em;
    z-index: 2;
    position: fixed;
}

#keyboardlayer {
    margin-top: 400px;
    margin-left: 25em;
    z-index: 1;
}

#pencilonelayer {
    margin-top: 550px;
    z-index: 1;
}

#penciltwolayer {
    margin-top: 450px;
    margin-left: 70em;
    z-index: 1;
}

最佳答案

为什么不尝试 overflow: hidden; 在容器上启动。我不是 100% 清楚你在这里做什么

关于html - 停止调整窗口大小的视差,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43241559/

相关文章:

html - 如何使 html 元素适合剩余高度?

javascript - 移动时的菜单不会滚动

html - 如何做好hr设计师

html - 如何为图标提供拨号功能

reactjs - 在 redux 中,为什么我们必须在 reducer 中保持状态不可变?

javascript - webpack开发服务器不是在内存中生成bundle.js吗?

javascript - 根据鼠标坐标显示图像点击功能

iphone - float : Left Not Working on iPhone

javascript - 在子悬停时更改父 css

javascript - 如何跟踪表单中的焦点元素