简体   繁体   English

JQM弹出示例不起作用

[英]JQM popup sample doesn't work

Trying to learn popup and found that JQM popup "Dialog" sample doesn't work - nothing appears when I press button "Delete page...". 尝试学习弹出窗口,发现JQM弹出窗口“对话框”示例不起作用-当我按下按钮“删除页面...”时,什么也没出现。 My html body is: 我的html正文是:

<div data-role="page" id="page_test1" data-theme="b">

<div data-role="content">
    <a href="#popupDialog" data-rel="popup" data-position-to="window" data-role="button" data-inline="true" data-transition="pop" data-icon="delete" data-theme="b">Delete page...</a>
    </div> <!-- /content -->
</div> <!-- /page -->

<!-- Exactly copied from http://view.jquerymobile.com/1.3.1/dist/demos/widgets/popup/ (sample "Dialog") -->
<div data-role="popup" id="popupDialog" data-overlay-theme="a" data-theme="c" data-dismissible="false" style="max-width:400px;" class="ui-corner-all">
    <div data-role="header" data-theme="a" class="ui-corner-top">
        <h1>Delete Page?</h1>
    </div>

    <div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
        <h3 class="ui-title">Are you sure you want to delete this page?</h3>
        <p>This action cannot be undone.</p>
        <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="c">Cancel</a>
        <a href="#" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">Delete</a>
    </div> <!-- content -->
</div>  <!-- popup -->

As you can see, my portion of html is a bit. 如您所见,我的html部分有点。 You can find such behaviour of popup here - http://jsfiddle.net/vbulash/YkEAj/ 您可以在此处找到弹出窗口的此类行为-http://jsfiddle.net/vbulash/YkEAj/

The popup must be inside the data-role="page" container. 弹出窗口必须位于data-role="page"容器内。

<div data-role="page" id="page_test1" data-theme="b">
    <div data-role="content">   <a href="#popupDialog" data-rel="popup" data-position-to="window" data-role="button" data-inline="true" data-transition="pop" data-icon="delete" data-theme="b">Delete page...</a>

    </div>
    <!-- /content -->
    <!-- Exactly copied from http://view.jquerymobile.com/1.3.1/dist/demos/widgets/popup/ (sample "Dialog") -->
    <div data-role="popup" id="popupDialog" data-overlay-theme="a" data-theme="c" data-dismissible="false" style="max-width:400px;" class="ui-corner-all">
        <div data-role="header" data-theme="a" class="ui-corner-top">
                <h1>Delete Page?</h1>

        </div>
        <div data-role="content" data-theme="d" class="ui-corner-bottom ui-content">
                <h3 class="ui-title">Are you sure you want to delete this page?</h3>

            <p>This action cannot be undone.</p>    <a href="#" data-role="button" data-inline="true" data-rel="back" data-theme="c">Cancel</a>
    <a href="#" data-role="button" data-inline="true" data-rel="back" data-transition="flow" data-theme="b">Delete</a>

        </div>
        <!-- content -->
    </div>
    <!-- popup -->
</div>
<!-- /page -->

http://jsfiddle.net/YkEAj/1/ http://jsfiddle.net/YkEAj/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM