在浏览器中滚动时移除反弹,位置:fixed div [英] Remove bounce on scroll in browser, issue with position:fixed div

查看:230
本文介绍了在浏览器中滚动时移除反弹,位置:fixed div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Chrome中滚动时移除反弹。你会注意到,顶部的白色黑色是固定的,并在所需的第二个黄色块后面。



我需要做的是删除滚动以显示灰色背景浏览器,而不防止在顶部白色块上滚动。希望有意义



HTML

 < div class =project> 
< / div>

< div id =content>

< div class =warface>
< / div><! - END warface - >

< / div><! - END content - >

解决方案

浏览器中的反弹滚动是OSX某些版本的功能。 p>

为了防止您的网站发生,您可以使用以下操作:



CSS / p>

  html,body {
height:100%;
overflow:hidden;
}

#mainContainer {
position:absolute;
top:0;
bottom:0;
left:0;
right:0; $ b $b overflow:auto;
}

HTML

 < body> 
< div id =mainContainer>
...
< / div>
< / body>

演示


I'm trying to remove the bounce when scrolling in chrome. You'll notice the top white black is fixed and behind the second yellow block as desired.

What I need to do is remove the scroll to reveal the grey background in the browser without preventing the scroll over the top white block. Hope it makes sense

HTML

<div class="project">
</div>

<div id="content">

    <div class="warface">   
    </div><!-- END warface -->

</div><!-- END content -->

解决方案

Bounce scroll in your browser is a feature of some versions of OSX.

To prevent it from happening on your website you can use following:

CSS

html, body {
    height: 100%;
    overflow: hidden;
}

#mainContainer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: auto;
}

HTML

<body>
    <div id="mainContainer">
        ...
    </div>
</body>

Demo

这篇关于在浏览器中滚动时移除反弹,位置:fixed div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆