系統城裝機大師 - 唯一官網:www.www.newsthatmovesu.com!

當前位置:首頁 > 網絡編程 > JavaScript > 詳細頁面

微信小程序將頁面按鈕懸浮固定在底部的實現代碼

時間:2020-10-29來源:www.www.newsthatmovesu.com作者:電腦系統城

 ps: 懸浮固定在頁面的底部,并且背景有白色層將頁面底部文字的顯示遮罩,一面影響顯示觀感。且不受頁面下拉上提的影響。

wxml代碼如下:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!--底部按鈕的背景層-->
<view class="baise"></view>
<!--底部按鈕-->
<view class="anniu">
 <button formType="submit" class="btn-normal btbdstk" bindtap="resetSalaryBtnClick" >
  <view class="bdstk" >
   <text >重置條件</text>
  </view>
 </button>
 <button formType="submit" disabled="{{disabled}}" class="btn-normal btbdstk" >
  <view class="sqdzk">
   <text>確認查詢</text>
  </view>
 </button>
 </view>

wxss樣式如下:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* 底部按鈕 */
.baise{
  background:#FFFFFF;
  display:flex;
  position:fixed;
  width:100%;
  height:150rpx;
  z-index:665;
  bottom:0rpx;
}
.anniu{
 display:flex;
 position:fixed;
 width:95%;
 z-index:666;
 bottom:55rpx;
}
.btbdstk{
 margin-left:30rpx;
 width:50%;
}
.bdstk{
 font-size:30rpx;
 color:#ffffff;
 width:100%;
 border:2rpx solid #ffffff;
 border-radius:15rpx;
 background:#78B8FD;
 height: 95rpx;
 text-align: center;
 line-height:95rpx;
}
.sqdzk{
 font-size:30rpx;
 color:#ffffff;
 width:100%;
 border:2rpx solid #ffffff;
 border-radius:15rpx;
 background:#FF7178;
 height: 95rpx;
 text-align: center;
 line-height:95rpx;
}

到此這篇關于微信小程序將頁面按鈕懸浮固定在底部的實現代碼的文章就介紹到這了

分享到:

相關信息

系統教程欄目

欄目熱門教程

人氣教程排行

站長推薦

熱門系統下載

24小时免费更新在线视频_丝袜放荡妩媚美腿娇妻_99re6这里有精品热视频_国色天香社区论坛