modal-dialog

Custom “confirm” dialog in JavaScript?

那年仲夏 提交于 2019-11-27 08:15:12
I've been working on an ASP.net project that uses custom 'modal dialogs'. I use scare quotes here because I understand that the 'modal dialog' is simply a div in my html document that is set to appear "on top" of the rest of the document and is not a modal dialog in the true sense of the word. In many parts of the web site, I have code that looks like this: var warning = 'Are you sure you want to do this?'; if (confirm(warning)) { // Do something } else { // Do something else } This is okay, but it would be nice to make the confirm dialog match the style of the rest of the page. However, since

How to create a modal window in pyqt?

耗尽温柔 提交于 2019-11-27 07:57:17
问题 I looked into the documentation and i found 'self.setWindowModality(QtCore.Qt.WindowModal)'. I added this function to my ' init ' function, but however still was not able to create a modal dialog box. Any help will be appreciated, Thank You. 回答1: QDialog has setModal() as found here. As the docs state: By default, this property is False and show() pops up the dialog as modeless. Setting this property to true is equivalent to setting QWidget.windowModality to Qt.ApplicationModal . As

Show a div as a modal pop up

家住魔仙堡 提交于 2019-11-27 07:41:09
I have the following div: <div id="divAlert"> <div id='divAlertText'>You must select a language.</div> <div id='divAlertButton' class='btn blue' onclick="HideAlert();">Ok</div> </div> Is this HTML page there are more divs and buttons. I want to show divAlert as a modal pop up. I know there is something in jQuery, I think, that I can use to show my div with a half transparent black background filling the entire page. But I can't remember its name. Any advice? you can use jquery dialog widget http://jqueryui.com/demos/dialog/ A simple modal pop up div or dialog box can be done by CSS properties

Twitter Bootstrap modal blocks text input field

前提是你 提交于 2019-11-27 07:34:19
I am trying to use a modal as a popup help window. I set backdrop to 'nothing'. When the modal is opened (without backdrop) input fields in 'original' page cannot be focused. Other input types (checkbox and button in example) work well... Any idea ? My code: <div class="container"> <!-- Button to trigger modal --> <form> <label>Input</label> <input type="text" placeholder="Type something…"> <label class="checkbox"> <input type="checkbox">Checkbox </label> <button type="submit" class="btn">Submit</button> </form> <!-- Button to trigger modal --> <a href="#myModal" role="button" class="btn" data

Multiple calls with Simple Modal OSX Style Dialog

痞子三分冷 提交于 2019-11-27 07:31:29
问题 I am using Simple Modal, the OSX style version. I have two calls to the modal and therefore two versions of content. When either of the buttons is clicked it selects only the first lot of content. There is nowhere to put a hook on the content like most modal windows as there is no javascript on the page to add parameters... only an external .js file which I don't want to touch for obvious reasons. Can anyone help me with this problem? 回答1: I did the same thing on a site I'm building. I just

JQuery Modal Boxes and Iframe

旧街凉风 提交于 2019-11-27 07:28:01
I've been using Simple Modal and i feel it doesn't live up to what i need at the moment. Is there a Modal Box that supports loading external files and allows those external files to close the modal box and redirect the parent page to some url. An example of what i want to do. You have a list of users, you could click "Add user" and a Modal Box with the form pops up, you fill that in and submit it. That would close the box and reload the user list page so you would see the user in the list. Then you could click "Edit user" and a Modal Box with the user info filled in the form fields would pop

Grey boxes appear in parts of embedded Google Map in modal box

*爱你&永不变心* 提交于 2019-11-27 07:00:40
I'm having a problem with embedding a Google Map via the v3 API in a modal box. Grey boxes appear in the map canvas when the modal is shown. Resizing the browser window, bringing up Web Inspector, etc. makes all map tiles visible, i.e. it "force re-render" the map. The parent element of the map element ( section#map-modal , see code below) has display: none set in its CSS on page load. The JS modal code automatically sets display: block when the show button is clicked. If I temporarily remove display: none from the modal element, the map renders correctly on page refresh. Isn't the Google Map

Close dialog on click (anywhere)

别来无恙 提交于 2019-11-27 06:33:23
Is there a default option to close a jQuery dialog by clicking somewhere on the screen instead of the close icon? Edit: Here's a plugin I authored that extends the jQuery UI Dialog to include closing when clicking outside plus other features: https://github.com/jasonday/jQuery-UI-Dialog-extended Here are 3 methods to close a jquery UI dialog when clicking outside popin: If the dialog is modal/has background overlay: http://jsfiddle.net/jasonday/6FGqN/ jQuery(document).ready(function() { jQuery("#dialog").dialog({ bgiframe: true, autoOpen: false, height: 100, modal: true, open: function() {

jQuery, MVC3: Submitting a partial view form within a modal dialog

对着背影说爱祢 提交于 2019-11-27 06:13:45
问题 I'm just playing around with jQuery and MVC3 at the moment, and am wondering how I can submit a form, which has been dynamically loaded into a jQueryUI dialog? My code so far consists of... Javascript/jQuery $(document).ready(function () { $('.trigger').live('click', function (event) { var id = $(this).attr('rel'); var dialogBox = $("<div>"); $(dialogBox).dialog({ autoOpen: false, resizable: false, title: 'Edit', modal: true, show: "blind", hide: "blind", open: function (event, ui) { $(this)

iphone UIAlertView Modal

跟風遠走 提交于 2019-11-27 06:04:42
问题 Is it possible to present a UIAlertView and not continue executing the rest of the code in that method until the user responds to the alert? Thanks in advance. 回答1: I guess stopping the code you meant was to stop the device to run the next code you have written after the alertview For that just remove your code after your alertview and put that code in the alertview delegate -(void) yourFunction { //Some code UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Your Message"