是否可以更改数据覆盖主题的不透明度?因为当对话框打开时,您可以看到页面仍在背景中,但模糊或明亮?
最佳答案
您需要在弹出代码中添加 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;
}
关于jQuery 移动覆盖主题半透明?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9789615/