美文网首页
uni-app h5 吸底部,滚动固定底部css

uni-app h5 吸底部,滚动固定底部css

作者: 毛毛v5 | 来源:发表于2020-03-13 12:58 被阅读0次

需要用到h5得position新属性 sticky。主要是uni-app,其中变量--window-bottom是uniapp得预定义变量。目的是底部空出tabbar的高度。
css如下:

.position-sticky {
    position: -webkit-sticky!important;
    position: sticky!important;
}
    
.fixed-bottom {
    position: fixed;
    right: 0;
    bottom: calc( var(--window-bottom) + 3px);
    left: 0;
    z-index: 1030;
    margin-bottom: 6;
}

h5代码:

<template>
    <view class="info position-sticky fixed-bottom" v-if="zmMusicInfo.songList.length > 0" >
....
    </view>
</template>

相关文章

网友评论

      本文标题:uni-app h5 吸底部,滚动固定底部css

      本文链接:https://www.haomeiwen.com/subject/mmrcshtx.html