0

我正在为 windows phone 开发一个应用程序。我在我的应用程序中显示 html 页面。我想在我的 html 页面中使用 jQuery 移动对话框。所以,我浏览了jquerymobile.com。因为,我对此很陌生,所以我无法理解任何事情。

谁能告诉我我应该怎么做才能在我的 html 页面中有 jquery 移动对话框?

4

1 回答 1

2

您在整个应用程序中使用 jQuery mobile 吗?还是只想要对话框?

如果您使用 jQuery mobile,则只能在标记中执行此操作。看看下面的代码;这是您希望弹出窗口出现的页面(HTML):

<body>
    <!-- This is your main page -->
    <div data-role="page">

        <div data-role="header">
            <h1>Page Title</h1>
        </div>

        <div data-role="content">
            <!-- This is the link that will open your popup.
            You can use either a anchor link to an id existing on this page,
            or you can reference a filename like "popup.html"-->
            <a href="#popup" data-rel="dialog" data-transition="pop" data-role="button">Open dialog</a>     
        </div>

        <div data-role="footer">
            <h4>Page Footer</h4>
        </div>

    </div>

    <!-- This is your popup "page" -->
    <div data-role="page" id="popup">

        <div data-role="header">
            <h1>This is your popup header</h1>
        </div>

        <div data-role="content">
             This is your popup content
             <a href="#" data-role="button">Do something here</a>
        </div>

    </div>
</body>

我在 jsfiddle 做了一个工作示例:http: //jsfiddle.net/mwfire/qaNZD/

不要忘记包含所有脚本和 css,在文档的“页面剖析”部分进行了说明。

并(再次)查看选项文档:http: //view.jquerymobile.com/1.3.2/dist/demos/widgets/dialog/

于 2013-08-30T16:15:19.770 回答