uni-app h5 吸底部,滾動固定底部css

需要用到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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章