所有页面都在jquery mobile中的多页面模板中可见 [英] All pages are visible in multi page template in jquery mobile

查看:58
本文介绍了所有页面都在jquery mobile中的多页面模板中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已经在jquery mobile中创建了一个mulipage模板,还有一个对话框页面。要求是当我们点击其中一个图标时它应该显示对话框但是问题是所有页面和对话框在同一页面中可见所有的时间都没有发生任何事件。请告诉我,如果我错过任何东西。

Have created a mulipage template in jquery mobile with a dialog page also.The requirement is when we click on one of the icons it should display the dialog box but the problem is all the pages and the dialog are visible in the same page allthe time without any events fired. please tell me if i am missing anything.

代码如下:

<!DOCTYPE html>
<html>
<head>
        <title>Dialog</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="lib/jquery.mobile-1.3.1.min.css" />
        <script type="text/javascript" src="lib/jquery-1.4.3.min.js"></script>
        <script type="text/javascript" src="lib/jquery.mobile-1.3.1.min.js"></script>
        <script></script>
    </head>
    <body>
        <div data-role="page" id="one">
            <div data-role="content" align="bottom">
                <p>
                    <a href="#dialog" data-rel="dialog" data-transition="pop">click for dialog</a>
                </p>
            </div>
        </div>
        <div data-role="page" id="dialog">
            <div data-role="header" data-theme="e">
                <h1>dialog.</h1>
            </div>
            <div data-role="header" data-theme="d">
                <h1>This is dialog.</h1>
            </div>
            <div data-role="footer">
                <h4>Footer</h4>
            </div>
        </div>
        <div data-role="page" id="two">
            <div data-role="header" data-theme="e">
                <h1>page2</h1>
            </div>
            <div data-role="header" data-theme="d">
                <h1>This is page2.</h1>
            </div>
            <div data-role="footer">
                <h4>Footer</h4>
            </div>
        </div>
    </body>
</html>


推荐答案

那是因为你使用的是旧版本的jQuery 。

That is because you are using too old version of jQuery.

使用 jQuery 1.8.3 或更高版本。 jQuery Mobile被锁定到某些 jQuery 版本,它不适用于旧版本。

Use jQuery 1.8.3 or higher. jQuery Mobile is locked to certain jQuery version and it will not work with older versions.

在您的情况下,您使用的是jQuery Mobile 1.3.1,因此对它的最低要求是 jQuery 1.8.3 ,但我建议您使用 1.9。

In your case you are using jQuery Mobile 1.3.1 so minimal requirement for it is jQuery 1.8.3 but I would advise you to use 1.9.

这篇关于所有页面都在jquery mobile中的多页面模板中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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