zoukankan      html  css  js  c++  java
  • 小程序 纵向轮播 显示3列 每次滚动一个效果

    wxml

    <view class="swiper-view">
     <swiper next-margin="100rpx"  previous-margin="100rpx" class="swiper_container" vertical="true" autoplay="true" circular="true" interval="2000">
      <block wx:for="{{msgList}}">
       <swiper-item>
        <view class="swiper_item">{{item.title}}</view>
       </swiper-item>
      </block>
     </swiper>
    </view>

    wxss

    .swiper-view{
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      border-radius: 5rpx;
      background: tomato
     }
     .swiper_container {
      height: 300rpx;
       90%;
     }
      
     .swiper_item {
      height: 50rpx;
       90%;
      font-size: 26rpx;
      white-space: nowrap;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      color: white
     }

    js

    Page({
      data: {
         msgList: [
          { title: "朋友圈" },
          { title: "文章" },
          { title: "公共号" },
          { title: "小程序" },
          { title: "音乐" },
          { title: "表情" },
          { title: "订阅号" }
       ]
     }
    })

  • 相关阅读:
    闭包和this
    闭包与变量
    闭包
    ES6扩展运算符的几个小技巧
    js对象的深拷贝
    js获取当前点击元素的索引
    前端学习指北
    css实现心形图案
    this 知多少
    js数字进制转换
  • 原文地址:https://www.cnblogs.com/yaoling/p/13256219.html
Copyright © 2011-2022 走看看