Lew
Lew

Reputation: 1461

jQueryMobile non-modal dialog

Is there any way to have a NON-modal dialog in jQueryMobile? The default dialogs created by jQueryMobile are default, and there are no options/switches for a non-modal flavor. Is there some supplemental JavaScript one could write or get to add a non-modal option, or is there a hack to the jQueryMobile JS to make a non-modal dialog available? Thanks.

Upvotes: 1

Views: 1155

Answers (2)

Ori
Ori

Reputation: 377

The above answer is great, but because it also include a solution for the popup to be draggable, it misses the point a little and don't give a simple answer on just preventing the modality. So I decided to add a clear explanation for those who needs it:

Jquery Mobile implement the modality of it's popup, by adding a transparent DIV which covers all the page. this DIV has a high z-index but this z-index is still lower than the popup DIV itself. In this way non of the elements under this transparent DIV can be clicked. If you want to prevent the modality, just disable this transparent DIV by changing it's CSS and setting it's display property to none. The ID of this DIV is the same ID as the popup with "-screen" suffix.

<style>
    .PopupID-screen {
       display:none;
    }
</style>

Upvotes: 0

Matthew Walker
Matthew Walker

Reputation: 2757

A good answer to your question has been provided by Gajotres in his answer to this question Draggable Non-Modal Popup Jquery Mobile.

The solution is a pretty intense hack into jQuery Mobile's inner workings. It would be much nicer is this were a part of the library itself.

Upvotes: 1

Related Questions