带有标题的JQueryMobile弹出窗口显示后退按钮

时间:2012-09-27 19:09:24

标签: jquery-mobile popup

我有一个调用弹出窗口的按钮:

<a id="clearAll" href="#confirmDelete" data-rel="popup" data-position-to="window" data-role="button" data-mini="true"  data-theme="c" data-transition="pop" >Clear Error</a>

<div data-role="popup" id="confirmDelete" data-overlay-theme="a" data-add-back-btn="false" data-theme="c" style="max-width: 400px;" class="ui-corner-all" >
    <div data-role="header" data-theme="a" class="ui-corner-top" data-add-back-btn="false">
        <h1>Clear Log?</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 all the entries in this log?</h3>
        <p>This action cannot be undone.</p>
        <div class="ui-grid-a">
            <div class="ui-block-a">
                <a href="#" data-role="button"data-theme="b">Delete</a>  
            </div>
            <div class="ui-block-b">
                <a href="#" data-role="button" data-rel="back" data-theme="c">Cancel</a>    
            </div>
        </div>
    </div>
</div>

如果调用此页面的链接不包含data-ajax =“false”,则弹出窗口包含后退按钮,即使data-add-back-btn =“false”。如何摆脱按钮?我确实想要主页面上的后退按钮,而不是弹出窗口。

1 个答案:

答案 0 :(得分:1)

好的@Christine,就像我评论的那样,弹出窗口甚至会为弹出窗口内的标题提供不同类型的后退/关闭按钮。但解决方案很简单:将以下内容添加到自定义css文件中(确保在jquerymobile css文件之后引用该文件):

div[data-role="popup"] div[data-role="header"] .ui-btn {
    display: none;
}

这应该隐藏所有弹出窗口标题栏内的所有按钮。随意定制!