jquery - Cordova/Jquery Mobile - 单击按钮激活两个页面?

标签 jquery jquery-mobile cordova

我正在使用 Cordova/Phonegap 和 jQuery Mobile 构建一个 HTML5 应用程序进行页面导航。

我有一个奇怪的问题,如果我单击主页标题栏中的按钮 - 页面转换会按预期触发 - 但如果后续页面上的同一位置有一个按钮,也会触发页面转换同时!?

不知道为什么或如何解决 - 有人经历过类似的事情吗?或者提供什么建议?

这些按钮只是 anchor 链接,如下 -

<a  href="#paySuccess" data-transition="slide" class="paypal"><Span></Span></A>

最佳答案

您好,我附上 jquery mobile 中页面导航的类似示例。

$(document).on('pageinit', '#index', function(){ 
    $(document).on('click', '#navigateButton', function(){        
        $.mobile.navigate( "#second", { transition : "slide", info: "info about the #bar hash" });
    });   

    $(document).on('click', '#navigateButton2', function(){        
        $.mobile.navigate( "#index", { transition : "slide", info: "info about the #bar hash" });
    });   
});

请在此处找到同一示例的 fiddle :jquerymobile Navigation

希望这会有用。谢谢。

关于jquery - Cordova/Jquery Mobile - 单击按钮激活两个页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18979572/

相关文章:

html - jQuery Mobile Phonegap iOS : Header flickers when I pull up keyboard

android - Cordova PushPlugin 在 Android 模拟器上未收到通知

jQuery 滚动到 iOS 地址栏顶部

asp.net - ASP.NET 模式屏幕的最佳选择

javascript - 使用ajax将数据从TinyMCE保存到php

带有 jQ​​uery 插件的 jQuery Mobile

javascript - 检索以 JSON 存储的特定数据

javascript - 在 HTML 表中强制执行唯一元组

php - websocket的服务器端需要什么?

android - Phonegap 设置 Cordova 错误 创建错误