两个绝对的div;一个滚动条出现;一个没有

时间:2014-03-17 04:16:36

标签: html css

这是我的网站:
http://bible.preahkumpii.com
一旦页面加载(它是一个Web应用程序),您将在#main div中看到两个绝对定位的div。使用#selector隐藏left:-100% div,并且不会显示滚动条。另一个div #searcher是一个兄弟,它与right:-100%的定位类似。但是,正如您所看到的,由于#searcher div存在,因此x滚动条被激活。我不要那个。我希望它与#selector div完全相同,完全隐藏它(滚动条和所有),直到用户激活它。这两个都是使用jQuery点击动画进入视图。

#selector {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: white;
    text-align: center;
    overflow: auto;
    z-index: 50;
}
#searcher {
    width: 100%;
    height: 100%;
    top: 0;
    position: absolute;
    white-space: nowrap;
    font-family: 'Battambang';
    font-size: 120%;
    right: -100%;
    text-align: center;
    z-index: 10;
    background: white;
}

1 个答案:

答案 0 :(得分:1)

您只需将overflow-x:hidden添加到body元素:

body {
    overflow-x: hidden;
}

你应该实现一个后退按钮。

相关问题