Is jQuery mobile overlay theme semi-transparent?

Can I change the opacity of the data overlay theme? When the dialog box opens, can you still see the page in the background, but blurry or light?

+3


source to share


1 answer


You need to add the attribute data-overlay-theme

to your popup code like in the following example:

<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>

      



And then you can control the opacity of the overlay placed on the background by adding something like your css like this:

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

      

+2


source







All Articles