transparent nested dialogs jquerymobile

i'm trying to create a modal dialog with jquery mobile rc2. I managed to get rid of the default ugly grey background and now the dialog appears over the page where it is created. You can look here to know how to do this. The problem is that i have a dialog that has some <li> elements inside and each of them opens another dialog. The second dialog does not get opened over the past one. Instead i get a white background that is even uglyer than the grey one. How to make the nested dialog appear over the parent one with a transparent background? Should i close the first dialog before opening the new one? You can look the code in action here. Thanks in advance!


Haven't had time to look into it very much, but it seems like it's not really an "extra" white overlay you're getting, but rather that the #main page becomes invisible and the white color of the background is actually the body element. So the question is why #main becomes invisible, I guess. Hope this helps in some way =)

@cpak is right even if he didn't provide any solution to the problem. However i did solve the issue following this steps: 1) add a .inactive class to the parent page

    display: block !important;

2) When you open any child popup add that class again

3) edit the .ui-dialog and .ui-dialo-overlay classes like this:

    background-color: rgba(34,34,34,0.25) !important;

    background-image: none;

4) When you close the last popup remove the .inactive class to restore the original opacity

Hope this helps someone, but hope that jquery mobile changes this odd behaviour even more!

see for a complete working solution. It is the same idea as the andreapier solution but gives also the small jQueryMobile javascript hook to bind the opening and closing of the dialogs.

working fine with the latest jQueryMobile (1.1.0).

I suggest to consider removing the fancy css transitions on opacity for older mobile browsers.

Need Your Help

Golang how to do type assertion for unknown interface?


I understand that I can get an object's value by reflection and then use type assertion to get back the actual object using: