我有具有div容器内部的三个div的一个页面:动态滚动区域
____________________
|------------------|
|| Expandable ||
|| ||
|------------------|
|------------------|
|| scroll area ||
|| ||
|------------------|
|------------------|
|| fixed ||
||----------------||
|__________________|
我的问题是,当顶部的div被扩展(由JavaScript组件)时,滚动区域被推下,在集装箱分区之外,而我需要它动态地收缩。 (固定div当前绝对定位,滚动div被压下)
它也不能使用固定的高度(例如像素),因为它需要动态调整到许多不同的屏幕尺寸。
视频的问题:https://youtu.be/M-isVl1hs8Q
CSS:
.scrollcontainer{
position:relative;
width:100%;
height:100%;
}
.floor{
width:100%;
height:100% - 60px;
display:flex;
flex-direction:column;
}
.item{
flex:1 1 auto;
}
.broom{
transition:1s linear all;
}
.dirt{
transition:1s linear all;
}
.rug{
display:block;
position:absolute;
bottom:0;
width:100%;
height:60px;
}
javaqscript/HTML:
<div className="scrollcontainer">
<div className="floor">
<div className="broom item">
<FoodItemList
foodItemList={[this.props.foodItem]}
user={this.props.user}
/>
</div>
<div className="dirt item">
<Scrollbars
autoHeight
>
<Comments comments={this.props.foodItem.comments} />
</Scrollbars>
</div>
</div>
<div className="rug">
<Paper style={styles.paper} zDepth={0}>
<div className="leftcolumn">
<TextField
style={{color: 'white'}}
hintText="You can leave a comment here"
onChange={this.handleComment}
value={this.state.commentText}
/>
</div>
<div className="rightcolumn">
<IconButton
iconStyle={styles.smallIcon}
style={styles.small}
onTouchTap={this.addComment}
>
<ContentSend color={lightGreenA200} />
</IconButton>
</div>
</Paper>
</div>
</div>
谢谢!
非常感谢您的回复,我已经编辑好例子,以适应我的,但遗憾的是问题仍然存在。我修改了我的问题,添加了当前正在使用的代码和问题的视频。任何建议您可能会非常感激! :) –
非常抱歉,刚刚注意到你的评论。现在看。将与我的回应编辑。 – MassDebates
如果您需要进一步的帮助,您应该制作一个可重现和展示问题的受控演示/测试案例。 – MassDebates