如何滚动“overflow:hidden;”保持侧面菜单隐藏在身体上?

时间:2014-07-30 12:17:04

标签: jquery html css

我有"溢出:隐藏;"在正文上保持幻灯片菜单不会滚动/查看。

我希望保持原样,但启用垂直滚动:

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

  <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>

3 个答案:

答案 0 :(得分:0)

设置overflow-x: hidden

body, html {
height: 100%;
margin: 0;
font-family: helvetica;
font-weight: 100;
overflow-x: hidden;
}

并且jsFiddle:http://jsfiddle.net/stritar/RWmW5/

答案 1 :(得分:0)

overflow-x: hidden;

上尝试:body, html

答案 2 :(得分:0)

body, html {
    height: 100%;
    margin: 0;
    font-family: helvetica;
    font-weight: 100;
    overflow-x: scroll;
}