1

モバイル アプリケーションの index.html と individual.html に 2 つの html ページがあります。Index.html ページには多くの仮想ページが含まれています。individual.html ページにボタンがあります。index.html の仮想ページにリンクしたいと考えています。

出来ますか?

それはどのように正確に行うことができますか?

助けてください、

ありがとう

4

1 に答える 1

1

individual.html次のように、でリンクされたボタンを作成できます。

<a data-role="button" rel="external" href="index.html#your_virtual_page">BUTTON</a>

index.htmlこれはあなたのファイルと可能性のあるものの実際の例ですindividual.html:

- index.html :

<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>
        <div id="home" data-role="page">
            <div data-role="content">
                HOME   
            </div>
        </div>

        <!-- THE VIRTUAL PAGE THAT WE WANT TO ACCESS FROM individual.html -->
        <div id="p2" data-role="page">
            <div data-role="content">
                PAGE 2!!!
            </div>
        </div>  
    </body>
</html>

- individual.html :

<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>
        <div id="home" data-role="page">
            <div data-role="content">
                <!-- YOUR LINK TO YOUR VIRTUAL PAGE IN index.html -->
                <a data-role="button" rel="external" href="./index.html#p2">TO PAGE 2</a>
            </div>
        </div>

        <div id="p1" data-role="page">
            <div data-role="content">
                P1
            </div>
        </div>      
    </body>
</html>

これが仲間に役立つことを願っています。

于 2012-09-29T06:14:49.570 に答える