首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在身体上滚动“溢出:隐藏;”,同时保持侧菜单隐藏?

如何在身体上滚动“溢出:隐藏;”,同时保持侧菜单隐藏?
EN

Stack Overflow用户
提问于 2014-07-30 12:17:04
回答 3查看 118关注 0票数 0

我有“溢出:隐藏;”在身体上,使幻灯片菜单隐藏在滚动/视图中。

我想保持它的原样,但使用垂直滚动:

http://jsfiddle.net/stritar/RWmW5/

代码语言:javascript
复制
  <body>
    <div class="container">
        <div id="sidebar">
            <ul>
                <li><a class="primary_menu" href="#">LINK</a></li>
                <li><a class="secondary_menu" href="#">Link small</a></li>
            </ul>
        </div>
        <div class="main-content">
            <div class="swipe-area"></div>
            <div id="sidebar-toggle">
                <svg data-toggle=".container" class="inline-svg" width="42px" height="42px" viewBox="0 0 42 42" enable-background="new 0 0 32 22.5" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"      xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
                <!-- Generator: Sketch 3.0.4 (8054) - http://www.bohemiancoding.com/sketch -->
                <title>Group</title>
                <desc>Created with Sketch.</desc>
                <defs></defs>

                <g class="svg-menu-toggle" sketch:type="MSLayerGroup">
                <circle class="round" fill="#3B3B41" sketch:type="MSShapeGroup" cx="21" cy="21" r="21"></circle>
                <rect class="bar" fill="#F2F2F2" sketch:type="MSShapeGroup" x="12" y="26" width="18" height="4"></rect>
                <rect class="bar" fill="#F2F2F2" sketch:type="MSShapeGroup" x="12" y="19" width="18" height="4"></rect>
                <rect class="bar" fill="#F2F2F2" sketch:type="MSShapeGroup" x="12" y="12" width="18" height="4"></rect>
                </g>

                </svg>  
            </div>

            <div class="intro">

            </div>
            <section class="test">
                test
            </section>
        </div>
    </div>

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-07-30 12:19:32

设置overflow-x: hidden

代码语言:javascript
复制
body, html {
height: 100%;
margin: 0;
font-family: helvetica;
font-weight: 100;
overflow-x: hidden;
}

和jsFiddle:http://jsfiddle.net/stritar/RWmW5/

票数 0
EN

Stack Overflow用户

发布于 2014-07-30 12:23:09

尝试:overflow-x: hidden; on body, html

票数 0
EN

Stack Overflow用户

发布于 2014-07-30 12:27:34

代码语言:javascript
复制
body, html {
    height: 100%;
    margin: 0;
    font-family: helvetica;
    font-weight: 100;
    overflow-x: scroll;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25036620

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档