【发布时间】:2020-02-07 17:17:33
【问题描述】:
我这里有这段代码(请以展开模式打开):
#wrapper {
position: fixed;
background: gray;
color: #fff;
bottom: 0;
left: 0;
right: 0;
border-radius: 12px 12px 0 0;
width: 100%;
}
#title {
text-align: center;
padding: 15px;
border-bottom: 1px solid white;
}
#notifications {
display: flex;
flex-direction: column;
overflow: scroll;
overflow-x: hidden;
}
.entry {
padding: 15px;
}
<div id="wrapper">
<div id="title">Notifications</div>
<div id="notifications">
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
<div class="entry">Test</div>
</div>
</div>
当您探索附近时,它应该就像在 Google 地图中一样。所以就像从底部向上滑动 div 一样。标题在未展开但通知不展开时应该可见。当我单击标题时,我希望将元素平滑扩展至视口的85%,以便用户可以滚动浏览通知。当他再次单击标题时,它应该会回到初始状态。
这可能吗?如果是,怎么做?
【问题讨论】:
标签: javascript jquery html css