javascript - 滚动内容应该被隐藏
问题描述
问题是我想修剪在内容 A 中滚动的内容 B,当它再次向下滚动时,它应该重新出现。
所以它应该是不可见的区域,它被推到内容 A 中。我怀疑我在这里需要 javascript 或者这只是 css 的同义词?
body {
background-image: url('https://placeimg.com/1000/1000/nature/grayscale');
background-repeat: no-repeat;
background-attachment: fixed;
}
div { padding:10px; }
.fixed {
position: fixed;
top: 100px;
left: 50px;
border: 1px solid red;
height:100px;
width:400px;
z-index: 10;
}
.content {
background:#fff;
width:400px;
height:1200px;
margin-top: 220px;
margin-left: 50px;
}
<!--
Bootstrap docs: https://getbootstrap.com/docs
-->
<div class="fixed">
Content A
</div>
<div class="content">
Content B
</div>
非常感谢您的帮助!Rufnex
解决方案
推荐阅读
- jquery - MVC 向控制器发送多个图像
- python - 如何优化此代码??(python)
- java - 从 mipmap 到 drawable
- javascript - 使用猫鼬向现有文档添加新属性
- python - 解析从 csv 生成的请求?
- git - 检查另一个分支 x 中未提交的更改,而不检查分支 x
- android - RxJava2 concat 运算符不返回适当的流
- python-3.x - 如何检查 dlib 是否正在使用 GPU?
- javascript - 当通过脚本标签请求捆绑时,如何配置 Webpack 4 以自动导入拆分块?
- java - 带有 Ant junitlauncher 的 JUnit 5:NoClassDefFoundError:org/junit/platform/launcher/core/LauncherFactory