jQuery移动叠加主题半透明?

时间:2012-03-20 15:21:17

标签: jquery html mobile

是否可以更改数据叠加主题的不透明度?对于打开对话框时,您可以看到页面仍在背景中但模糊或亮起?

1 个答案:

答案 0 :(得分:2)

您需要在弹出代码中添加data-overlay-theme属性,如下例所示:

<div data-role="popup" id="popupDialog" data-overlay-theme="b" data-theme="b" data-dismissible="false" style="max-width:400px;">
    <div data-role="header" data-theme="a">
        <h1>Delete Page?</h1>
    </div>
    <div role="main" class="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="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back">Cancel</a>
        <a href="#" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b" data-rel="back" data-transition="flow">Delete</a>
    </div>
</div>

然后你可以通过添加类似于你的css的内容来控制放在背景页面上的叠加层的不透明度:

.ui-popup-screen {
    background-color: #000 !important;
    opacity: 0.75 !important;
}
相关问题