Closing popup windows on click - javascript

I found this nifty popup window JavaScript code that I like over at How to Auto Popup a CSS3 Modal Window When Page Loads?
Problem is that I want the user to simply click away from the box and that would cause it to close.
I tired to use self.close () from http://www.javascript-coder.com/window-popup/javascript-window-close.phtml but I cant figure out how to apply to everything else around the box. So when the users clicks anything outside the box it will close the popup.
Along with that I want to make sure that when the user closes the popup that it does not return during their php session. So basically unless they close their browser and bring it up again it will remain closed.

Related

How to bring popup browser window to the front so its on top of all browser windows?

My application gives users a specific amount of time to pay for a service. We do this because we can only keep their reservation for X amount of time.
The time we give them should be sufficient, however if they are running out of time we notify them with a Bootstrap Modal as shown below:
However, as soon as the modal achieves focus by the user clicking on the button or anywhere on the modal window, the PayPal browser window moves behind the main window. See picture below.
Simple clicking anywhere on the black overlay will bring the Paypal browser window back. However, I was hoping that someone might have some idea on how to achieve this using the button click in the modal.
In other words, how can I bring the Paypal browser window back to the front by clicking on the 'Yes Please' button on the modal or the close event of the modal?
I have tried to simulate the clicking of the overlay element in code but it does not seem to work.
Here is the code of the page:
From what I have read because the PopUp browser window is being opened from an iframe and the content is from a different source I cannot access the popup for security reasons. So there is no way to move it to the front unless the user clicks the dark overlay or the link 'Click to Continue'

Dialog box minimizes on clicking elsewhere in the main window

I'm using
dialog.showMessageBox([browserWindow, ]options[, callback])
to confirm a delete operation.I expect the user to close the dialog box first in order to perform some other operations.However, when the dialog box pops up the user is still able to click other parts of the window and on doing so the dialog box minimizes automatically.
Is there a way to restrict a user not to do anything else unless the dialog box is closed ?
Note: On Atom Editor do the following:
File -> Open File , this results in a dialog box for opening a file and while this dialog box is opened, the user is not able to click on anything on the main screen. This is the same behavior I'm looking at.
Check out this feature that was recently added: https://github.com/electron/electron/pull/6140

how to make pop up window and parent window both active

I want to open a pop up window and submit data through it. But as soon as I click outside of this small window, this popup gets closed. I want that both the windows should be active.
Please help

How can I make my chrome extensions popup to remain open unless closed?

Currently I have this :
I'd like to add an close[x] button at the right bottom corner. The popup should close only if user clicks on it. Now, it is closing whenever a click is made on the page.
How can I implement this?
Thanks in advance

Fading modal window in jQuery

I have a form that is editable by the user. Once he clicks the "Save" button, a modal window pops up saying something like "Changes saved" and then fades away automatically. I prefer that this modal window not be able to be interacted with or grey out the background screen.
Some of the examples I see with modal windows require clicking a button to show the window but then you have to click outside the modal window to close it. Is there a way to make it automatic?
Yes just pop-up a div and after you save the settings, do (function(){ var mzk = $('mark_zuckenberg').show(); setTimeout(function(){mzk.fadeOut('slow')},5000); }()); and it'll do what you want.

Categories