我有一个简单的2面板布局,左侧面板滚动,右侧面板不滚动。我想在滚动div的右侧添加一个淡入淡出,但到目前为止,我已经得到它以使淡入淡出位于正确的位置see here,或者它是静态的,但在目标区域之外,like this。
我需要做些什么才能让淡入淡出处于正确的位置?
html,
body,
.row,
.row > div {
height: 100%;
}
.content:before {
content: "";
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 5%;
/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,b7b7b7+100&0+0,0.65+100 */
background: -moz-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(183, 183, 183, 0.65) 100%);
/* FF3.6-15 */
background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0) 0%, rgba(183, 183, 183, 0.65) 100%);
/* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(183, 183, 183, 0.65) 100%);
/* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#a6b7b7b7', GradientType=1);
/* IE6-9 */
}
.content {
overflow-y: auto;
}
.bar {
background-color: red;
}
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-sm-3 col-sm-push-9 bar clearfix">
Menu
</div>
<div class="col-sm-9 col-sm-pull-3 content">
Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />Content
<br />
</div>
</div>
答案 0 :(得分:1)
以下是我提出的建议:
right
定位25.5%
设置为@media
以匹配通过Bootstrap类的一列与另一列的比率right
查询以处理较小的屏幕尺寸,以将0
设置回{{1}} https://github.com/GetStream/stream-js/blob/master/README.md