开始做的时候,遇到了个要用ionic实现

有一系列的序列需要展示,但是当前页面上只能展示一小部分,剩余的在没有出现时是隐藏的,还得能滑动出现,但是又不能有滚动条。

之前使用jQuery来实现的话,其实就是一个向左滑动的图片切换。

想着这个功能其实还是蛮常见的,ionic的framework应该能实现。然后就查看了一下文档,发现slides是可以实现的。

一开始直接粘贴了文档里面的代码,想着能自己直接修改样式来实现,设置slide宽度为20%,每次可展示5个序列。但是这样修改的话,使用this.slides.currentIndex获取到的值,是当页的值,而不是希望的slide的序列。

然后不得不仔细查看文档,然后就看到了这么个属性

slidesPerView number

Slides per view. Slides visible at the same time. Default: 1.

使用方法如下:

this.slides.slidesPerView = 5;

页面上就可以同时展现5个序列了。

其他属性如下:

Attr Type Details 中文
autoplay number

Delay between transitions (in milliseconds). If this parameter is not passed, autoplay is disabled. Default does not have a value and does not autoplay. Default: null.

是否自动播放

centeredSlides boolean

Center a slide in the middle of the screen.

在页面居中

control Slides

Pass another Slides instance or array of Slides instances that should be controlled by this Slides instance. Default: null.

 
dir string

If dir attribute is equal to rtl, set interal _rtl to true;

设置滚动的方向,从左还是从右

direction string

Swipe direction: 'horizontal' or 'vertical'. Default: horizontal.

水平还是竖直方向的滚动

effect string

The animation effect of the slides. Possible values are: slidefadecubecoverflow or flip. Default: slide.

切换的方式

initialSlide number

Index number of initial slide. Default: 0.

初始状态从第几个slide开始

loop boolean

If true, continuously loop from the last slide to the first slide.

滚动到最后一个slide时是否切换到第一个

pager boolean

If true, show the pager.

是否在下方展示当前的序列。即一般图片切换时的下方的圆点

paginationType string

Type of pagination. Possible values are: bulletsfractionprogress. Default: bullets. (Note that the pager will not show unless pager input is set to true).

与上面一项对应,设置其格式

parallax boolean

If true, allows you to use "parallaxed" elements inside of slider.

 
slidesPerView number

Slides per view. Slides visible at the same time. Default: 1.

设置每次展现几个slide

spaceBetween number

Distance between slides in px. Default: 0.

slide的间距

speed number

Duration of transition between slides (in milliseconds). Default: 300.

滚动速度

zoom boolean

If true, enables zooming functionality.

https://ionicframework.com/docs/api/components/slides/Slides/#resize

ionic学习使用笔记(二) slide 组件的使用的更多相关文章

  1. Netty学习笔记(二)——netty组件及其用法

    1.Netty是 一个异步事件驱动的网络应用程序框架,用于快速开发可维护的高性能协议服务器和客户端. 原生NIO存在的问题 1) NIO的类库和API繁杂,使用麻烦:需要熟练掌握Selector.Se ...

  2. Scala学习教程笔记二之函数式编程、Object对象、伴生对象、继承、Trait、

    1:Scala之函数式编程学习笔记: :Scala函数式编程学习: 1.1:Scala定义一个简单的类,包含field以及方法,创建类的对象,并且调用其方法: class User { private ...

  3. Unityclient框架笔记二(组件实体开发模式的思考)

    Unity的Entity-Component-System实现的很美丽,很灵活.许多文章也对这样的组件实体的开发模式倍加推崇.由于它契合这么一条规则:优先使用组合而不是继承. 可是实际开发过程中,限制 ...

  4. 剑指offer学习读书笔记--二维数组中的查找

    在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都是按照从上到下递增的顺序排序.请设计一个函数,输入这样的一个二维数组和一个整数,判断数组是否含有这个整数. 1 2 8 9 2 4 9 1 ...

  5. ionic学习使用笔记(一) 版本更新及创建项目时遇到的问题解决

    最近开始用ionic开发项目,虽然去年的时候用ionic 2.0 开发过公司的项目,不过现在的ionic已经升级到了ionic framework 3.0 了.而且还有个 ionic-cli . 使用 ...

  6. 深度学习入门教程UFLDL学习实验笔记二:使用向量化对MNIST数据集做稀疏自编码

    今天来做UFLDL的第二个实验,向量化.我们都知道,在matlab里面基本上如果使用for循环,程序是会慢的一逼的(可以说基本就运行不下去)所以在这呢,我们需要对程序进行向量化的处理,所谓向量化就是将 ...

  7. U3D学习使用笔记(二)

    1.在移动端www.texture使用时不能实时加载纹理,www.LoadImageIntoTexture使用没问题 2.public FaceFeature FaceFeatureData      ...

  8. ionic slide组件使用

    ionic学习使用笔记 slide 组件的使用   开始做的时候,遇到了个要用ionic实现 有一系列的序列需要展示,但是当前页面上只能展示一小部分,剩余的在没有出现时是隐藏的,还得能滑动出现,但是又 ...

  9. amazeui学习笔记二(进阶开发5)--Web 组件开发规范Rules

    amazeui学习笔记二(进阶开发5)--Web 组件开发规范Rules 一.总结 1.见名知意:见那些class名字知意,见函数名知意,见文件名知意 例如(HISTORY.md Web 组件更新历史 ...

随机推荐

  1. 分布式ID生成 - 雪花算法

    雪花算法是一种生成分布式全局唯一ID的经典算法,关于雪花算法的解读网上多如牛毛,大多抄来抄去,这里请参考耕耘的小象大神的博客ID生成器,Twitter的雪花算法(Java) 网上的教程一般存在两个问题 ...

  2. jmeter模拟spike尖峰测

    jmeter模拟spike尖峰测试 概述 尖峰测试(Spike testing)在性能测试中属于压力测试的一个子集.指的是在某一瞬间或者多个频次下用户数和压力陡然增加的场景. 为了验证我们的网站在访问 ...

  3. 【ABAP系列】SAP ABAP ALV中的TOP_OF_PAGE添加任意图标

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[MM系列]SAP ABAP ALV中的TOP_ ...

  4. idea多行注释缩进

    选中多行代码 - 按下tab键——向后整体移动 选中多行代码 - 按下shift + tab键——向前整体缩进(整体去掉代码前面的空格)

  5. git比较重要但是又容易忘记的操作

    git rebase head~1   把多次commit合并成一次 git reset head  撤销已缓存的内容 git checkout . git stash      去除改动未提交的代码

  6. nginx 配置总结

    可以选择在http{ }中设置:client_max_body_size 20m; 也可以选择在server{ }中设置:client_max_body_size 20m; 还可以选择在locatio ...

  7. JAVA Error:The project was not built since its build path is incomplete. Cannot find the class file for java.util.Map$Entry.....

    今天,学习Netty框架时遇到error:Description Resource Path Location Type:The project was not built since its bui ...

  8. (六:NIO系列) 相关设计模式

    出处:  反应器模式 vs 观察者模式  反应器模式 vs 生产者消费者模式 反应器模式 vs 观察者模式 反应器模式 是一种为处理服务请求并发提交到一个或者多个服务处理程序的事件设计模式.当请求抵达 ...

  9. QT中使用Event Filter监听button事件,Release后button不见

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/zhenyu5211314/article/details/27201043 问题RT,在程序中我使用 ...

  10. 2018-8-10-win10-uwp-读写XML

    title author date CreateTime categories win10 uwp 读写XML lindexi 2018-08-10 19:16:51 +0800 2018-2-13 ...