Css 在同一html文件中的窗口之间移动

Css 在同一html文件中的窗口之间移动,css,jquery-mobile,Css,Jquery Mobile,我将使用本教程开始使用jQuery Mobile: 但我现在有个问题,我不明白 当文件名index.html中包含下面的代码时,我可以在不同的窗口之间导航,但如果在名为index3.html的文件中包含相同的代码,这将不再有效 有人知道原因吗?有解决办法吗 <!DOCTYPE html> <html> <head> <title>Page Title2</title> <meta name="viewp

我将使用本教程开始使用jQuery Mobile:

但我现在有个问题,我不明白

当文件名
index.html
中包含下面的代码时,我可以在不同的窗口之间导航,但如果在名为
index3.html
的文件中包含相同的代码,这将不再有效

有人知道原因吗?有解决办法吗

<!DOCTYPE html>
<html>
    <head>
    <title>Page Title2</title>

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <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=win>
        <!-- Default theme -->
        <div data-role=header>
            <h1>Default theme</h1>
        </div>

        <div data-role=content>
            <p>
                Window content
            </p>
            <a href=#wina> Goto "a" theme </a>
        </div>
    </div>

    <div data-role=page id=wina data-add-back-btn=true>
        <div data-role=header data-theme=a>
            <h1> "a" theme </h1>
        </div>

        <div data-role=content data-theme=a>
            <p>
                Window content
            </p>
            <a href=#winb> Goto "b" theme </a>
        </div>
    </div>

    <div data-role=page id=winb data-add-back-btn=true>
        <div data-role=header data-theme=b>
            <h1> "b" theme </h1>
        </div>

        <div data-role=content data-theme=b>
            <p>
                Window content
            </p>
            <a href=#winc> Goto "c" theme </a>
        </div>
    </div>

    <div data-role=page id=winc data-add-back-btn=true>
        <div data-role=header data-theme=c>
            <h1> "c" theme </h1>
        </div>

        <div data-role=content data-theme=c>
            <p>
                Window content
            </p>
            <a href=#wind> Goto "d" theme </a>
        </div>
    </div>

    <div data-role=page id=wind data-add-back-btn=true>
        <div data-role=header data-theme=d>
            <h1> "d" theme </h1>
        </div>

        <div data-role=content data-theme=d>
            <p>
                Window content
            </p>
            <a href=#wine> Goto "e" theme </a>
        </div>
    </div>

    <div data-role=page id=wine data-add-back-btn=true>
        <div data-role=header data-theme=e>
            <h1> "e" theme </h1>
        </div>

        <div data-role=content data-theme=e>
            <p>
                Window content
            </p>
            <p>
                End of themes
            </p>
        </div>
    </div>

</body>
</html>

选择:单页导航或多页导航。两种解决方案同时生成重复的元素IDs@grigno,但是如果我有不同的ID,这不应该解决问题吗?我在每个页面上都有不同的ID。我不明白为什么我可以有两个导航。。。你看到我的编辑了吗?好的,很抱歉我没有读对。我知道你想同时使用两种导航类型。。。
        <div data-role=content>
            <a href=index3.html> Goto default themes</a>
        </div>