sencha touch Carousel 自动切换
代码是在网上找的,忘记原出处了
/**
* 跑马灯自动切换
*/
Ext.define('ux.RotatingCarousel', {
extend: 'Ext.carousel.Carousel',
alternateClassName: 'rotatingCarousel',
xtype: 'rotatingCarousel',
config: {
delay: 3000,
start: true,
listeners: {
tap: {
fn: function () {
this.pause();
},
element: 'element'
},
swipe: {
fn: function () {
this.start();
},
element: 'innerElement'
}
}
},
initialize: function () {
if (this.config.start) {
this.start();
}
},
rotate: function () {
if (this.timeout) {
clearTimeout(this.timeout);
}
if (this.getActiveIndex() === this.getMaxItemIndex()) {
this.setActiveItem(0, 'slide');
} else {
this.next();
}
this.timeout = Ext.defer(this.rotate, this.config.delay, this);
},
start: function (delayStart) {
this.timeout = Ext.defer(this.rotate, delayStart || this.config.delay, this);
},
pause: function (delayStart) {
if (this.timeout) {
clearTimeout(this.timeout);
}
if (delayStart) {
this.start(delayStart);
}
return this;
},
stop: function (delayStart) {
this.pause(delayStart);
this.setActiveItem(0, 'slide');
return this;
}
});
使用:
Ext.define('app.view.Home', {
extend: 'Ext.Container',
xtype: 'home',
requires: ['ux.RotatingCarousel'],
config: {
items: [{
xtype: 'rotatingCarousel',
height: '200px',
items: [{
html: '<div class="homeImg" style="background-image:url(\'resources/images/lg1.png\')"></div>'
},
{
html: '<div class="homeImg" style="background-image:url(\'resources/images/lg2.png\')"></div>'
},
{
html: '<div class="homeImg" style="background-image:url(\'resources/images/lg3.png\')"></div>'
}]
}]
}
});
sencha touch Carousel 自动切换的更多相关文章
- sencha touch carousel 扩展 CardList 可绑定data/store
扩展代码: /* *扩展carousel *通过data,tpl,store配置数据 */ Ext.define('ux.CardList', { extend: 'Ext.carousel.Caro ...
- sencha touch 可自动增长高度TextArea
js代码如下: /* *高度自动增长的文本框 */ Ext.define('ux.TextArea', { extend: 'Ext.field.TextArea', xtype: 'autoText ...
- sencha touch JsonP 自动提示消息 masked
//公用类 Ext.define('app.util', { alternateClassName: 'util', statics: { /*为Ext.Viewport添加一个消息提示组件(需要初始 ...
- 【翻译】使用Sencha Touch开发Google Glass应用程序
原文:Developing for Google Glass with Sencha Touch 作者:Ross Gerbasi Ross Gerbasi is a Senior Engineer a ...
- sencha touch 问题汇总
做sencha touch有一段时间了,目前而言,sencha touch在android上问题比较严重,在此对android中sencha touch的问题做一些汇总: 1.内存问题: 打包成安装程 ...
- 关于用phonegap 3.0+ 打包后sencha touch按钮点击切换动画延迟接近一秒的以及界面闪烁的解决方案
android的webview对硬件加速的支持貌似很不理想,在开启硬件加速的情况下,css3这些需要调用硬件加速的样式会大幅拖慢html5的webapp,在htc的部分手机上还会因开启硬件加速而导致闪 ...
- Sencha touch Panel之间的跳转(如不使用TabPanel或者Carousel控件而产生跳转的动画效果)
常规的Sencha touch 应用都是"header content footer"结构,这样的结构无疑将使用TabPanel来实现,而且TabPanel肯定是card布局,这样 ...
- sencha touch 在安卓中横屏、竖屏切换 应用崩溃问题
答案来至于 Sencha Touch 交流 @周旭 这是由于横竖屏转换导致activity重跑onCreate方法导致的,有两种解决方案:1.横竖屏转换的时候不要重新跑onCreate方法,这个可以在 ...
- 动端逐渐出了许多的移动端的框架,比如Sencha Touch、JQTouch、Jquery-moblie、jqMobi等等。这些框架都有优缺点,不同的框架应用在不同的项目中。现简单阐述一下各框架的优缺点:
移动前端工作的那些事---前端制作之微信小技巧篇 (2013-11-15 15:20) 转载▼ 标签: it css3/javascript html5 webapp 手机网站搭建 分类: 前端制 ...
随机推荐
- u3d加载加密和未加密
using UnityEngine; using System.Collections; public class loadnew : MonoBehaviour { public bool IsCo ...
- 下拉刷新XListView的简单分析
依照这篇博文里的思路分析和理解的 先要理解Scroller,看过的博文: http://ipjmc.iteye.com/blog/1615828 http://blog.csdn.net/wangji ...
- Asp.net中文本框全选的实现
一.鼠标滑过textbox全选 前台: <asp:TextBox runat="server" onMouseOver="this.focus();this.sel ...
- 【Dynamic Programming】DP算法
http://www.hawstein.com/posts/dp-novice-to-advanced.html
- python06 深浅拷贝原理
preface 这里主要说深浅拷贝的原理.首先说说数字与字符串作为内存对象的重用,请看代码: a1=12345 b1=12345 a2=a1 print(id(a1),id(b1),id(a2)) 打 ...
- Google语音识别API 使用方法
官方位置:https://cloud.google.com/speech/
- tomcat和nginx的使用
1.下载tomcat,配置conf/server.xml,在Host节点下添加Context节点,指定程序目录: <Context path="/ol" docBase=&q ...
- 本地存储(LocalStorage、SessionStorage、Web SQL Database、Indexed DB)
https://www.cnblogs.com/SeeYouBug/p/6127001.html https://blog.csdn.net/inter_peng/article/details/49 ...
- Windows系统下运行某些程序时缺少“Msflxgrd.ocx”的解决方法
出现这样的错误就是系统缺少相应的库文件,我们安装即可. 下载Msflxgrd.ocx,这里提供一个下载网址:https://www.ocxme.com/files/msflxgrd_ocx 64位系统 ...
- 基于github+hexo搭建个人博客(window)
0x01 环境搭建 1.Node.js环境 下载Node.js安装文件:https://nodejs.org/en/download/ 根据系统选择相应安装包下载,安装过程一路Next,默认设置即可. ...