swiper标签

<!--index.wxml-->
  <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000">
   <block wx:for="{{movies}}" wx:for-index="index">
    <swiper-item>
     <image src="{{item.url}}" class="slide-image" mode="aspectFill"/>
    </swiper-item>
   </block>
  </swiper>
//index.js
//获取应用实例
var app = getApp()
Page({
 data: {
  movies:[
  {url:'http://img04.tooopen.com/images/20130712/tooopen_17270713.jpg'} ,
  {url:'http://img04.tooopen.com/images/20130617/tooopen_21241404.jpg'} ,
  {url:'http://img04.tooopen.com/images/20130701/tooopen_20083555.jpg'} ,
  {url:'http://img02.tooopen.com/images/20141231/sy_78327074576.jpg'}
  ]
 },
 onLoad: function () {
 }
})
/**index.wxss**/
.swiper {
 height: 400rpx;
 width: 100%;
}
.swiper image {
 height: 100%;
 width: 100%;
}

效果图

微信小程序轮播图的更多相关文章

  1. 图解微信小程序---轮播图

    图解微信小程序---轮播图 代码笔记 第一步:在页面创建swiper组件 第二步:编写js页面 注意事项:wx:for渲染我们js中的图片数组,item默认写法,获取我们的图片数组中的图片,可通过增加 ...

  2. 微信小程序------轮播图

    swiper 微信小程序实现轮播图,和网站,APP的效果差不多,代码少,效率高. 先来看看效果图: 主要用swiper + swiper-item来实现 <view class='swiper' ...

  3. 微信小程序——轮播图实现

    小程序的轮播图,也就是他其中的一个控件可以算是直接上代码: 这是WXML 页面 代码: <view class='carousel_div'> <swiper class=" ...

  4. 微信小程序轮播图的制作与跳转

    <!--轮播图 --> <view class='swiperBanner'> <swiper indicator-dots='{{indicatorDots}}' au ...

  5. 微信小程序--轮播图,标题,盒子,tab栏的合成例子

    小程序是什么? 微信小程序,是一种不需要下载安装即可使用的应用,用户扫一扫或搜一下即可打开应用,在微信-发现-小程序可打开应用. 一.小程序的样式编写: 目录结构: app.json { " ...

  6. 微信小程序轮播图组件 swiper,swiper-item及轮播图片自适应

    官网地址:https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html index.wxml文件 indicator-d ...

  7. 一分钟学会如何自定义小程序轮播图(蜜雪冰城Demo)

    最近开发小程序项目用到了轮播图,默认的有点单调,作为后端程序员,研究一番最终实现了.本文会从思路,代码详细介绍,相信读过此文后,不管以后在开发中碰到轮播图还是需要自定义修改其他的样式都可以按这个思路解 ...

  8. 02微信小程序-轮播的宽度100%显示和轮播的基础配置

    1==>如何让轮播的宽度100%显示? 你先给swiper 外面添加一个大盒子,给大盒子一个类 . <view class='lunbobox'> 然后wxss 里面设置 image ...

  9. 微信小程序轮播组件

    在index.wxml中添加以下代码 <view> <swiper indicator-dots="{{indicatorDots}}" autoplay=&qu ...

随机推荐

  1. Js表单验证控件(使用方便,无需编码)-01使用说明

    演示地址:http://weishakeji.net/Utility/Verify/Index.htm    开源地址:https://github.com/weishakeji/Verify_Js ...

  2. mysql url 连接配置的一个小坑。 工作中不会遇到。 学习的时候会

    <property name="driverClassName"> <value>com.mysql.jdbc.Driver</value> & ...

  3. Xampp相关命令

    http://www.upwqy.com/details/5.html 1 启动关闭 需要切换目录: # cd /opt/lampp/ 启动 XAMPP # ./lampp start 停止 XAMP ...

  4. java--Object类接受任意引用数据类型对象

    java学习进展到类,首先就对万类之父Object类进行举例练习,这里我是对一维数组和接口用Object接受数组和接口. package test1; public class enum1 { pub ...

  5. win8.1下无法运行vc++6.0的解决方法

    参考网址: http://wenku.baidu.com/link?url=A6mzeCDLNW1vCV7Vm5p83jqSzguiOFlH5FX-7kdN9NJXS_ORXYuaVDn1Prnz_F ...

  6. Readiness 探测 - 每天5分钟玩转 Docker 容器技术(144)

    除了 Liveness 探测,Kubernetes Health Check 机制还包括 Readiness 探测. 用户通过 Liveness 探测可以告诉 Kubernetes 什么时候通过重启容 ...

  7. Linux增加LV(逻辑卷)容量

    Linux增加LV(逻辑卷)容量 2017-09-29-17:34:13 个人原创博客,转载请注明出处. 查看逻辑卷的相关命令: lvs vgs 命令: [root@arch ~]# vgs VG # ...

  8. Linux环境下安装配置Node.js

    1.在官网查看版本,LTS代表长期支持的版本 2.进入服务器 3.输入命令:·wget https://npm.taobao.org/mirrors/node/v8.9.3/node-v8.9.3-l ...

  9. 使用git提交到github,每次都要输入用户名和密码的解决方法

    使用git提交文件到github,每次都要输入用户名和密码,操作起来很麻烦,以下方法可解决,记录以下. 原因:在clone 项目的时候,使用了 https方式,而不是ssh方式. 默认clone 方式 ...

  10. C语言的隐式类型转换

    看了一篇博文,该文章中有如下描述 #include <stdio.h> int main() { unsigned ; unsigned ; )) //a和b-1的结果-1都被转换为int ...