Sencha Touch/HTML5从左到右滑动事件/效果

Tom*_*PPC 2 html5 swipe sencha-touch

我尝试在Sencha Touch或HTML5中从左到右进行滑动事件/效果.因此,如果HTML页面在iOS上运行,那么如果用户用手指在屏幕上从左到右移动/滑动它,它应该开始动画.

有什么想法可以"轻松"完成吗?

Nic*_*muz 7

如果我理解正确,如果用户向左/向右滑动屏幕,则需要切换内容.我认为最简单的方法是使用Carousel.请看一下Sencha Touch Kitchen Sink示例(用户界面 - >旋转木马):http: //dev.sencha.com/deploy/touch/examples/kitchensink/

以下是从Kitcen Sink中获取的代码示例,演示了Carousel的使用:

new Ext.Panel({
    cls: 'cards',
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    defaults: {
        flex: 1
    },
    items: [{
        xtype: 'carousel',
        items: [{
            html: '<p>Navigate the carousel on this page by swiping left/right.</p>',
            cls: 'card card1'
        },
        {
            html: '<p>Clicking on either side of the indicators below</p>',
            cls: 'card card2'
        },
        {
            html: 'Card #3',
            cls: 'card card3'
        }]
    }]
});
Run Code Online (Sandbox Code Playgroud)

  • @Richard感谢我的最好方法是接受答案!:) (2认同)