Identify whether dialog is modal or non modal in jquery - jquery-ui

How to identify whether the dialog opened is modal or non modal in jQuery?
I am working on an application where I need to take action only on modal dialog and not on non modal dialog.

Use the option method:
$("#dialog").dialog("option", "modal")
This will return true or false for whether the dialog is a modal or not.
jsFiddle example

Related

how to prevent fancybox2 modal from closing until user clicks the actual close button?

I'm hoping to use Fancybox2 to display a modal edit form for a rails 3.2 application, but if the end user clicks anywhere outside the modal window then fancybox closes.
Is there a way to disable that so the modal will not close (throwing away their edits) if they accidentally click on the underlying web page?
If not, can anyone suggest a simple rails 3.2 gem to implement modal popup form editing?

Open Modal Form from other Modal Form JQuery

I'm using a JQuery Modal Form for ask some question to the user, I want that when the user click on OK button (Create an account for demo) open other JQuery Modal Form....
How Can I do it?

Programatically open a dialog as popup with jQuery Mobile

So I have a page and a dialog. When the user click the page button, one AJAX request will open the dialog with the results. Something like that simple example without AJAX: http://jsfiddle.net/rBBpx/
It works. The dialog opens programatically. But it hides the page content, showing the dialog as if it's another page. I know that popup's can open dialogs in-page with links, but I didn't get the point in how I can do that programatically.
I tried to change $.mobile.changePage() call to that, but it didn't worked as I expected:
$('#dialog').popup();
$('#dialog').popup('open');
How can I show that dialog in-page, as a popup? Is it ever possible? Thank you in advance!
In case you use phonegap, there is an alert plugin: http://docs.phonegap.com/en/edge/cordova_notification_notification.md.html
navigator.notification.alert("your AJAX result here");

jquerymobile background popup disable touch

sorry if my english bad
when I create a dialog popup with jquerymobile, I get a transparent background, but when I touched it, causing the closure of the dialogue, how do I make the dialog will not close when I touch the background until I touch the cancel button?
thank you
for example login form dialog button in demos jquerymobile
http://jquerymobile.com/demos/1.2.0/docs/pages/popup/index.html
You can add data-dismissible="false" attribute as it describes in the document:
http://api.jquerymobile.com/popup/#option-dismissible
This behavior of a jQM popup is by design.
It looks like instead of a popup you just need to use a jQM modal dialog

Twitter Bootstrap Closing Modal

I'm using the Twitter Bootstrap to make a project that opens modals with buttons. Each modal closes if you click on the same button that opens it. The modals will also close if you press escape or click on the background. However, if you click on the button to open one modal and then the button for another modal, the code opens both modals. If any modal is open, I want it to close when you click anywhere else on the page, including any of the other buttons. I'm really lost with the JavaScript, though.
Your question appears vague, so I will try to touch most of the points so that your question gets answered.
If you want the modal should not close on pressing esc or clicking some where else then try this....
<a data-controls-modal="your_div_id" data-backdrop="static"
data-keyboard="false" href="#">
To show a modal. use this inside a javascript function:
$('#myModal').modal('show')
To hide a modal use this:
$('#myModal').modal('hide')
To toggle a modal use this:
$('#myModal').modal('toggle')
Use these according to your need, hide a modal when you need may be on a button click.
I think this much is sufficient to achieve whatever you need.
If anything you aren't able to get something please post a comment.
Cheers!!!

Resources