Sencha Touch / HTML5从左到右滑动事件/效果 [英] Sencha Touch/HTML5 Swipe event/effect from left to right

查看:153
本文介绍了Sencha Touch / HTML5从左到右滑动事件/效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I try to do a swipe event/effect from left to right in Sencha Touch or HTML5. So if the HTML page runs on iOS then it should start an animation if the user touche ans moves/swipe with the finger from the left to the right on the screen.

任何想法如何轻松完成?

Any ideas how this can be done 'easily'?

推荐答案

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

If I understood you correctly, you want to switch content if the user swipes the screen to either left/right. I believe the easiest approach is to use a Carousel. Please have a look at the Sencha Touch Kitchen Sink example (User Interface -> Carousel): http://dev.sencha.com/deploy/touch/examples/kitchensink/

以下是从Kitcen Sink获取的代码示例这证明了使用轮播:

Below is a code example taken from the Kitcen Sink that demonstrates the use of a 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'
        }]
    }]
});

这篇关于Sencha Touch / HTML5从左到右滑动事件/效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆