微信小程序横向滚动Scroll-view,左侧固定右侧滚动视图详解

微信小程序横向滚动Scroll-view在这里插入图片描述
在这里插入图片描述

<view class="horizontal-scroll">
  <view class="fixed-content">
    <view class="th" bindtap="showAll">课程代码及名称</view>
    <view class="td" bindtap="showAll">00597英语写作</view>
    <view class="td" bindtap="showAll">04729大学语文</view>
    <view class="td" bindtap="showAll">00831英语语法</view>
    <view class="td" bindtap="showAll">01232毛泽东与马克思主义思想概论</view>
  </view>
  <view class="scroll-content">
    <scroll-view class="scroll-view_w" scroll-x style="width:100%">
      <view class="item">
        <view class="th">成绩</view>
        <view class="td">98</view>
        <view class="td">69</view>
        <view class="td">64</view>
        <view class="td">98</view>
      </view>
      <view class="item">
        <view class="th">考试年月</view>
        <view class="td">201804</view>
        <view class="td">201804</view>
        <view class="td">201804</view>
        <view class="td">201804</view>
      </view>
      <view class="item">
        <view class="th">考试时间</view>
        <view class="td">7日09:00-11:00</view>
        <view class="td">7日14:00-16:00</view>
        <view class="td">8日09:00-11:00</view>
        <view class="td">8日14:00-16:00</view>
      </view>
      <view class="item">
        <view class="th">课程代码及名称</view>
        <view class="td">00597英语写作</view>
        <view class="td">04729大学语文</view>
        <view class="td">00831英语语法</view>
        <view class="td">01232毛泽东与马克思主义思想概论</view>
      </view>
    </scroll-view>
  </view>
</view>

css样式:

.horizontal-scroll {
  overflow: hidden;
}

.fixed-content {
  float: left;
  width: 35%;
}

.scroll-content {
  float: left;
  width: 65%;
}

.scroll-view_w {
  width: 100%;
  white-space: nowrap;
}

.scroll-view_w .item {
  width: 100px;
  display: inline-block;
}

.horizontal-scroll .th {
  background: #f5f5f5;
  height: 40px;
  padding:0 10px;
  line-height: 40px;
  text-align: center;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horizontal-scroll .td {
  background: #fff;
  padding:0 10px;
  font-size: 15px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom:1rpx solid #eee;
}
.horizontal-scroll .td:nth-last-child(2n+1){
  background: #fafafa;
}
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值