微信小程序 左右分類滾動列表


今天需求個類似得到app分類的功能,效果如圖:

左右分別滾動,互不干擾,先把簡單的布局和樣式搭好。

<view class="page">
  <view class="flex_row">
    <view class="nav_left" >
      <view style="height:1500rpx;">左側分類</view>
    </view> 
    <view class="nav_right">
      <view class="nav_right_top">右側頂部分類</view>
      <scroll-view class="nav_right_list" scroll-y="true">
        <view style="height:1200rpx;">右側列表</view>
      </scroll-view>
    </view>
  </view>
</view>
.flex_row{display: flex;flex-direction: row;}
.nav_left{width: 25%;height:100vh;overflow-y:auto; }
.nav_right{width: 75%;position: relative;}
.nav_right .nav_right_top{padding-top:20rpx;position: fixed;top:0;right:0;width: 75%;height:80rpx;font-size:30rpx;
border-bottom: 1px solid #dedede;display:flex;flex-direction:row;white-space: nowrap;background: #fff;z-index: 99}
.nav_right_list{margin-top:80rpx;height:calc(100vh - 80rpx);}

簡單的效果已經出來了,往里面填充數據就好了。。

完整代碼:

https://www.cnblogs.com/joe235/p/11464841.html

下面的實例寫在另篇文章里,鏈接: https://www.cnblogs.com/joe235/p/11464841.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM