使用jQuery移动版的导航标签与Google Play商店类似 [英] Navigation tabs with jQuery mobile similar to Google Play store

查看:130
本文介绍了使用jQuery移动版的导航标签与Google Play商店类似的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用jQuery mobile执行这种类型的导航标签,类似于Google Play商店?

How can I do this type of navigation tabs with jQuery mobile, similar to the Google Play store?

推荐答案

您可以使用滑动事件和jquery动态切换在HTML的部分之间使用切换,或使用$ .mobile.changePage(url),示例

You can use swipe events and with jquery dynamically switch between parts of you html using toggle, or using $.mobile.changePage(url), example

$('div[data-role=page]').on('swipeleft, swiperight ', go);

function go(event) {
    switch(event.type) {
        case 'swiperight':
            console.log('swiperight');
            $('#divid2,#divid3').toggle(false);
            $('#divid1').toggle(true);
            break;
        case 'swipeleft':
            console.log('swipeleft');
            $('#divid1,#divid2').toggle(false);
            $('#divid3').toggle(true);
            break;
    }
}

像这样,或者你可以使用jquery animate fadeOut部分,或使用$ .mobile.changePage(url),它可以在不同的页面之间转换,如果你有相同的页眉和页脚,它将看起来像选项卡。

Something like that or you can use jquery animate to fadeOut parts of the html, or use $.mobile.changePage(url) which can transition between different pages and it will look like tabs if you have same headers and footers.

这篇关于使用jQuery移动版的导航标签与Google Play商店类似的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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