Skip to content

Instantly share code, notes, and snippets.

@tqc
Created April 19, 2012 12:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save tqc/2420690 to your computer and use it in GitHub Desktop.
Save tqc/2420690 to your computer and use it in GitHub Desktop.
jQuery mobile dialog transparency fix
.ui-dialog-background {
opacity: 0.5;
display: block !important;
-webkit-transition: opacity 0.5s ease-in;
}
.ui-dialog-background.pop.in {
opacity: 1;
-webkit-transition: opacity 0.5s ease-in;
}
.ui-dialog {
min-height: 100% !important;
background: transparent !important;
}
$(function() {
$('div[data-role="dialog"]').live('pagebeforeshow', function(e, ui) {
ui.prevPage.addClass("ui-dialog-background ");
});
$('div[data-role="dialog"]').live('pagehide', function(e, ui) {
$(".ui-dialog-background ").removeClass("ui-dialog-background ");
});
});
@Nemesisss
Copy link

Hi,

Just wondering how you get the dialog that is opened not to also have the same transparency applied to it's background. I have tried your code and its very close to what I need but I can't seem to get the transparency to apply only to the parent dialog. I've tried everything, and the transparency gets added to the background of the dialog or popup that is opened.

thanks

@mauiflipper
Copy link

Can you make an example of this in FS Fiddle with the new JQM 1.3.1?

@angelfangulo
Copy link

Ok. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment