0

我有这个文档,其中定义了两个简单的页面:

 //page1
         ...
         <a href="#dialog" id="link_open_dialog" data-rel="dialog">Click me</a>
         ...

 //page2
    <div data-role="page" id="dialog">           
         <div data-role="header">
                <h1>Something</h1>
          </div>
          <div data-role="content" id="textDialog">
              something
          </div>  
     </div>   

但问题是我看不到对话框,从来没有............是我认为最简单的情况

4

3 回答 3

0

问题是模板中的一个参数。与 jquery Mobile 无关。该参数是一个空链(“”),但我不知道因为那部分完全不完整,所以很难测试它。非常感谢,我花了几个小时来解决这个简单的问题

于 2012-10-03T01:11:25.937 回答
0

我认为您没有正确定义 jQuery Mobile 的引用,或者您可能会检查控制台是否有错误。

尝试以下工作示例:

<html>
    <head>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile.structure-1.1.1.min.css" />
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script> 
    </head>

    <body>
        <!-- PAGE 1 -->
        <div id="page_1" data-role="page">
            <div data-role="content">
                <a href="#dialog" id="link_open_dialog" data-rel="dialog">Click me</a>
            </div>
        </div>

        <!-- PAGE 2: DIALOG -->
        <div data-role="page" id="dialog">           
            <div data-role="header">
                <h1>Something</h1>
            </div>
            <div data-role="content" id="textDialog">
                something
            </div>  
        </div>  
    </body>
</html>
于 2012-10-03T00:50:32.450 回答
-2

不熟悉这个插件,但看起来你需要指定data roleas "button",否则不会触发任何事件......只是一个猜测。

<a data-role="button" data-rel="dialog">hello</a>

    <div data-role="dialog">Hello World</div>
于 2012-10-03T00:46:24.343 回答