modal-dialog

jquery fancybox - prevent close on click outside of fancybox

无人久伴 提交于 2019-11-27 18:08:34
问题 I'm using the Fancybox plugin for my modal windows. It seems like no matter what options I use I can't prevent the fancybox modal window from closing when the user clicks outside of the fancybox modal window (grayed out area). Is there a way to force the user to click the X or a button that I trigger the close event? This seems like it should be simple so I'm hoping I'm just reading the examples wrong. I've tried hideOnContentClick: false but that doesn't seem to be working for me. Any ideas?

how to center a popoverview in swift

核能气质少年 提交于 2019-11-27 18:07:48
I have the following code to show a popoverview (dialog) without an arrow, which works fine. The only problem is, that the dialog is shown in the top left (IPad). I would like to center the view on the screen. What to change or add in my following code ? : func show_help(){ let storyboard = UIStoryboard(name: "Main", bundle: nil) let controller = storyboard.instantiateViewControllerWithIdentifier("Help") as! UIViewController controller.modalPresentationStyle = UIModalPresentationStyle.popover let popoverPresentationController = controller.popoverPresentationController // result is an optional

Bootstrap modal opening on page load [duplicate]

試著忘記壹切 提交于 2019-11-27 18:07:39
问题 This question already has an answer here: Launch Bootstrap Modal on page load 18 answers I got a page with a bootstrap modal on it (manual: http://getbootstrap.com/javascript/#modals). I would like to have this modal open on page load. However this is not happening. <!-- Modal --> <div class="modal fade" id="memberModal" tabindex="-1" role="dialog" aria-labelledby="memberModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button

How to center a modal window on a page?

北城以北 提交于 2019-11-27 18:04:08
问题 I am trying center a modal window in the browser page. I just want to center it, so that it should be responsive for all the screens. 回答1: With position:absolute Assuming your modal is 300x300 .modal { width: 300px; height: 300px; position: absolute; left: 50%; top: 50%; margin-left: -150px; margin-top: -150px; } With display:table An alternative way for that is to make display table <div class="modal"> <div class="body"> <div class="content"> Content goes here </div> </div> </div> <style>

jquery-ui Dialog: Make a button in the dialog the default action (Enter key)

不打扰是莪最后的温柔 提交于 2019-11-27 17:57:23
In a jquery modal dialog, is there a way to select a button as the default action (action to execute when the user presses enter)? Example of jquery web site: jquery dialog modal message In the example above the dialog closes when the user presses Esc. I would like the "Ok" button action to be called when the user presses Enter. In your dialog's open function, you can focus the button: $("#myDialog").dialog({ open: function() { $(this).parents('.ui-dialog-buttonpane button:eq(0)').focus(); } }); Change the :eq(0) if it's at a different index, or find by name, etc. Eugenio Miró I like this one

Bootstrap Modal Dialog. Can the grid system be used within a modal context?

本秂侑毒 提交于 2019-11-27 17:17:30
问题 I have a Bootstrap modal dialog for which I want to layout the various labels and inputs. I have tried using row/column classes but they do not appear to do anything. What are my options here? Thanks, Doug 回答1: I got it working ok...http://www.bootply.com/WAwE3QyUdb Add a col to the container inside the modal-body. <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h3>Modal header</h3> </div> <div class="modal-body"> <div class="container col-md-12"> <div class

How to auto-center jQuery UI dialog when resizing browser?

主宰稳场 提交于 2019-11-27 17:04:17
When you use jquery UI dialog, all works well, except for one thing. When the browser is resized, the dialog just stays in it's initial position which can be really annoying. You can test it out on: http://jqueryui.com/demos/dialog/ Click on the "modal dialog" example and resize your browser. I'd love to be able to let dialogs auto-center when the browser resizes. Can this be done in an efficient way for all my dialogs in my app? Thanks a lot! Setting the position option will force this, so just use the same selector covering all your dialogs where I use #dialog here (if it doesn't find them

Calling a function on bootstrap modal open

陌路散爱 提交于 2019-11-27 17:02:09
I used to use JQuery UI's dialog, and it had the open option, where you can specify some Javascript code to execute once the dialog is opened. I would have used that option to select the text within the dialog using a function I have. Now I want to do that using bootstrap's modal. Below is the HTMl code: <div id="code" class="modal hide fade"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3>Modal header</h3> </div> <div class="modal-body"> <pre> print 'Hello World' And as for the button that opens the modal: <a href="#code"

Is it possible to determine whether ViewController is presented as Modal?

只谈情不闲聊 提交于 2019-11-27 16:58:45
Is it possible to check inside ViewController class that it is presented as modal view controller? Gabriele Petronella Since modalViewController has been deprecated in iOS 6, here's a version that works for iOS 5+ and that compiles without warnings. Objective-C: - (BOOL)isModal { return self.presentingViewController.presentedViewController == self || (self.navigationController != nil && self.navigationController.presentingViewController.presentedViewController == self.navigationController) || [self.tabBarController.presentingViewController isKindOfClass:[UITabBarController class]]; } Swift:

How to handle the modal closing event in Twitter Bootstrap?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 16:51:55
In Twitter bootstrap, looking at the modals documentation. I wasn't able to figure out if there is a way to listen to the close event of the modal and execute a function. e.g. lets take this modal as an example: <div class="modal-header"> <button type="button" class="close close_link" data-dismiss="modal" aria-hidden="true">×</button> <h3>Modal header</h3> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <a href="#" class="btn close_link" data-dismiss="modal">Close</a> </div> The X button on top and the close button on bottom can both hide/close the modal because of data