zoukankan      html  css  js  c++  java
  • 小程序实现轮播图

    先看效果:

     上代码:

    1.  html页面

    <!--pages/swiper/swiper.wxml-->
    <swiper 
      indicator-dots="true" 
      autoplay="true" 
      interval="1000" 
      duration="800"
      circular="true"
    >
    <!-- <block wx:for="{{imgUrls}}"> -->
    <view>
    <swiper-item>
    <image src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.7v6.net%2Fuploads%2Fallimg%2F200417%2F141-20041F93144926.jpg&refer=http%3A%2F%2Fwww.7v6.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1625966518&t=e04664d665442db8ec5a7ca155095867" class="slide-image" />
    </swiper-item>
    <swiper-item>
    <image src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.7v6.net%2Fuploads%2Fallimg%2F200417%2F141-20041F93144926.jpg&refer=http%3A%2F%2Fwww.7v6.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1625966518&t=e04664d665442db8ec5a7ca155095867" class="slide-image" />
    </swiper-item>
    <swiper-item>
    <image src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.7v6.net%2Fuploads%2Fallimg%2F200417%2F141-20041F93144926.jpg&refer=http%3A%2F%2Fwww.7v6.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1625966518&t=e04664d665442db8ec5a7ca155095867" class="slide-image" />
    </swiper-item>
    </view>
    </swiper>
     

    2.   当然是css
    swiper {
      height: 400rpx;
       100%;
    }
    swiper-item {
      height: 100%;
       100%;
    }
    .slide-image{
       height: 100%;
       100%;
    }
     
    3.  就没有了,就这样就可以了。快去试试吧!如果不错请点赞评论
  • 相关阅读:
    认识Backbone (二)
    认识Backbone (一)
    认识Underscore
    了解HTML5和“她”的 API (三)
    了解HTML5和“她”的 API (二)
    了解HTML5和“她”的 API (一)
    javascript中的“向量”
    使用HTML5 Canvas做些什么
    IE6浏览器的一些问题
    javascript动画中的“帧”
  • 原文地址:https://www.cnblogs.com/zhang-hong/p/14873811.html
Copyright © 2011-2022 走看看