微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Sencha touch ::使TabPanel始终向左滑动

如何解决Sencha touch ::使TabPanel始终向左滑动

|| 有什么方法可以使TabPanel始终在sencha touch中滑动“向左”吗?     

解决方法

我认为您的操作类似(对不起,目前无法测试):
new Ext.TabPanel({
fullscreen: true,defaults:{animation: new Ext.Anim({
    direction: \'left\',cover: false,reveal: false,before: function(el) {
        var curZ = el.getStyle(\'z-index\') == \'auto\' ? 0 : el.getStyle(\'z-index\'),zIndex = curZ + 1,toX = 0,toY = 0,fromX = 0,fromY = 0,elH = el.getHeight(),elW = el.getWidth();

        if (this.direction == \'left\' || this.direction == \'right\') {
            if (this.out == true) {
                toX = -elW;
            }
            else {
                fromX = elW;
            }
        }
        else if (this.direction == \'up\' || this.direction == \'down\') {
            //if (this.out == true) {
            //    toY = -elH;
            //}
            //else {
                fromY = elH;  //Always slide to the left???
            //}
        }

        if (this.direction == \'right\' || this.direction == \'down\') {
            toY *= -1;
            toX *= -1;
            fromY *= -1;
            fromX *= -1;
        }

        if (this.cover && this.out) {
            toX = 0;
            toY = 0;
            zIndex = curZ;
        }
        else if (this.reveal && !this.out) {
            fromX = 0;
            fromY = 0;
            zIndex = curZ;
        }

        this.from = {
            \'-webkit-transform\': \'translate3d(\' + fromX + \'px,\' + fromY + \'px,0)\',\'z-index\': zIndex,\'opacity\': 0.99
        };
        this.to = {
            \'-webkit-transform\': \'translate3d(\' + toX + \'px,\' + toY + \'px,\'opacity\': 1
        };
    }
})
},items: [
    {
        title: \'Tab 1\',html : \'1\',cls  : \'card1\'
    },{
        title: \'Tab 2\',html : \'2\',cls  : \'card2\'
    },{
        title: \'Tab 3\',html : \'3\',cls  : \'card3\'
    }
]
});
    

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。