zoukankan      html  css  js  c++  java
  • 微信小程序分类导航图标左右滑动

    wxml

    <scroll-view scroll-y="true" scroll-into-view="{{scrollIntoView}}" bindscroll="onScroll">
        <swiper class="page_class" indicator-dots="true" autoplay="" interval="" duration="500">
            <block wx:if="{{homeDate.brand}}">
                <swiper-item>
    
                    <view class="page_li center" wx:for="{{homeDate.brand}}" catchtap='toList' data-cateid="{{item.id}}" data-pid="-2">
                        <block wx:if="{{index<8}}">
                            <image src='{{item.logo}}' mode='aspectFill'></image>
                            <text>{{item.name}}</text>
                        </block>
                    </view>
    
                </swiper-item>
            </block>
            <block wx:if="{{homeDate.brand.length>7}}">
                <swiper-item>
                    <view class="page_li page_num center" wx:for="{{homeDate.brand}}" catchtap='toList' data-cateid="{{item.id}}" data-pid="-2">
                        <block wx:if="{{index>7}}">
                            <image src='{{item.logo}}' mode='aspectFill'></image>
                            <text>{{item.name}}</text>
                        </block>
                    </view>
                </swiper-item>
            </block>
        </swiper>
    </scroll-view>

    wxss

    .page_class{padding:0 0 20rpx;margin-top: 20rpx;white-space: nowrap;height: 360rpx;}
    .page_class .page_li{ 20%;margin-top: 20rpx;color: #3d3d3d;}
    .page_class image{ 90rpx;height: 90rpx;border-radius: 50%;display: block;margin: 0 auto 8rpx;}
    .page_class .page_li {float: left;display: -webkit-flex;flex-direction: column;flex-wrap: wrap; 25%;text-align: center;margin: 10rpx 0;}
    .swiper-box .wx-swiper-dots.wx-swiper-dots-horizontal{margin-bottom: 2rpx;}
    .page_class .wx-swiper-dot{40rpx;display: inline-flex;height: 10rpx;justify-content:center;border-radius: 6rpx;margin: 0;}
    .page_class .wx-swiper-dot::before{content: '';flex-grow: 1;background: rgba(255,255,255,0.8);border-radius: 6rpx;}
    .page_class .wx-swiper-dot-active::before{background:#f6414a;}
    .page_num:nth-child(-n+8){display: none;}
  • 相关阅读:
    吃饭吧唧嘴的童鞋看过来
    CUDA 6.5 && VS2013 && Win7:创建CUDA项目
    IDM下载工具
    virgo虚拟桌面
    北方民族大学计算机科学与工程学院研究生导师
    从图片加载纹理-使用glut工具
    OpenGL Vertex Array
    OpenGL顶点缓冲区对象(VBO)
    几何画板5.03
    VS(VisualStudio)中折叠代码、打开代码的快捷键
  • 原文地址:https://www.cnblogs.com/liweitao/p/13030375.html
Copyright © 2011-2022 走看看