【问题标题】:JQueryMobile Popup with Header displays back button带有标题的 JQueryMobile 弹出窗口显示后退按钮
【发布时间】:2013-11-01 14:27:08
【问题描述】:

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

<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",弹出窗口也会包含一个后退按钮。如何摆脱按钮?我确实想要主页上的后退按钮,而不是弹出窗口上。

【问题讨论】:

  • 嗨!你用的是什么版本的 jQuery Mobile?
  • 我得到了类似但不一致的行为。文档说将弹出 div 嵌套在 div[data-role="page"] 中,并带有调用弹出窗口的链接。在常规“页面”中,弹出窗口将有一个黑色的“返回”按钮。在“对话”页面中,弹出窗口可能会或可能不会在标题的左角有一个小的“X”按钮,但绝不会出现黑色的“返回”按钮。

标签: jquery-mobile popup


【解决方案1】:

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

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多