0

index.html と c.html の 2 つのファイルがあります。

入力すると

<a data-rel="dialog" data-transition="flip" href="c.html">button</a>

index.html では、c.html をダイアログとして表示する必要があります。ただし、

<a data-rel="dialog" data-transition="flip" href="c.html#0">button</a>

まったく機能しません (c.html で id="0" ページを表示したかった)。それを機能させる方法は?

4

1 に答える 1

6

これはできません。

jQuery Mobile は、内部/埋め込みページへのクエリ パラメータの受け渡しをサポートしていませんが、この機能をサポートするためにプロジェクトに追加できるプラグインが 2 つあります。軽量のページパラメータプラグインと、backbone.js または spin.js で使用するためのより完全な機能を備えたjQuery Mobile ルーター プラグインがあります。routerliteと呼ばれる新しいプラグインは、routeinit、routechange、pageinit、pagechange の 4 つのメソッドだけでシンプルに保ちます。

公式ドキュメント: http://jquerymobile.com/demos/1.2.0/docs/pages/page-navmodel.html

証拠:

index.html

<!DOCTYPE html>
<html>
<head>
    <title>jQM Complex Demo</title>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
        <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>  
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>    
</head>
<body>
    <div data-role="page" id="index">
        <div data-theme="a" data-role="header">
            <h3>
                First Page
            </h3>
            <a href="index3.html#second" class="ui-btn-right">Next</a>
        </div>

        <div data-role="content">

        </div>

        <div data-theme="a" data-role="footer" data-position="fixed">

        </div>
    </div>  
</body>
</html>   

index3.html

<!DOCTYPE html>
<html>
<head>
    <title>jQM Complex Demo</title>
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no; target-densityDpi=device-dpi"/>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
        <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>  
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>    
</head>
<body>
    <div data-role="page" id="third">
        <div data-theme="a" data-role="header">
            <h3>
                Third Page
            </h3>
            <a href="#second" class="ui-btn-right">Next</a>
        </div>

        <div data-role="content">

        </div>

        <div data-theme="a" data-role="footer" data-position="fixed">

        </div>
    </div> 
    <div data-role="page" id="second">
        <div data-theme="a" data-role="header">
            <h3>
                Second Page
            </h3>
            <a href="#index" class="ui-btn-left">Back</a>
        </div>

        <div data-role="content">

        </div>

        <div data-theme="a" data-role="footer" data-position="fixed">

        </div>
    </div>    
</body>
</html>   
于 2013-03-28T19:43:08.913 に答える