Any Ideas?
I tried inserting ....({ .....,...., close:false,....}) and nothing.
Thanks in advance.
PS: I will close the modal window when satisfied with $.modal.close();
If you call a modal window as you have indicated {close:false}, the following will happen:
The closeHTML will not be displayed
The user cannot click the overlay to close the dialog
The user cannot press ESC to close the dialog
If you have a button/link in your code with the simplemodal-close class, the user will still be able to press that to close the dialog.
So, based on the information you have provided, if you are using {close:false}, the only other way possible for a user to close the dialog is if you have provided a way for them to. As such, you need to hide, disable, or remove the simplemodal-close class until you are ready for them to close the dialog.
Related
first of all, sorry for my bad english.
I would like to create a "like-close" button for my site. Now I'll explain what I mean.
I've created 2 div, 1 for an overlay background in all the browser window and one for a window where I ask users to "Like" my facebook page.
I have also created a close button for hide the 2 divs and in this button I have hidden another Facebook Like Button and, when a user try to close the popup, he will put a "Like". In this button I wrote "close and like" so, for who thinks It's a clickjacking, the users know what they are doing.
I've been able to close the window in the same moment when the user click on the button on the first time (so, before he didn't like my page) with the method
FB.Event.subscribe('edge.create', function(response) {
jQuery('#overlay').hide(); //hide the overlay
jQuery('#popoup').hide(); //hide the popup window
});
Now when he visit my page again, the popup will appear again and I don't know how to close it without "dislike" the page.
I tried to bind an event "click" in the iframe of like button but it didn't work.
I tried to bind an event in the wrapper of the iframe but it didn't work...
So I have no more ideas and I know it's possibile because I saw this trick in another web site.
Thank you all for help
Sorry, in the button where I hide the Facebook like I wrote "like and close". It's the only button in the Window for show the main page content just to fans.
I have added a div which contains some survey questions which is initially hidden. Once the user closes the window or navigate away from the page, I need to popup the survey div to get the confirmation. I know there is a browser default confirm box method by using onbeforeunload event. But I need to popup the div rather than the browser default confirm box. Is there any way to do this? (or is there any way to interrupt the close event without even clicks on the "Stay on page" button found in the browser default confirm box?)
UPDATE : it seems we cannot do the action you are asking. There are some solutions to cover this in IE but overall its not possible. Ignore all the previous code.
For a reason, I have to use pop up window instead of modal window. I want the user do everything with the menu I provide inside the pop up window. Unfortunately, I can't disable the default close button (in the right top corner of the pop up window) and I don't want my user to use it.
After I googled it, I found it's impossible to make it disable, but in a forum (I forget the link) I found someone gave a trick to handle it: open the same pop up window when it's closed with that button. He didn't give sample code for it. How to do it? I don't know how to give function in that default close button. Please help.
I am trying to open a link in a new tab/window when a user presses a key.
Here is the function I made for opening a link, it gets called when the user presses the "X" key.
function open_link() {
window.open($("#active").attr("link"), '_blank');
}
My page consists of a bunch of divs looking like this, and the user sets the active one by navigating up/down with the keys j/k. All this works, but the problem is that there is a popup blocked warning when the "X" key is pressed to open the link.
<div class="read entry" id="active" entryNumber="0" entryId="733" link="http://www.reddit.com/r/buildapc/comments/1aux43/build_help_ordering_soon_final_review/">
I don't think you can disable popup blocker from javascript. If you could, then popup blockers would be quite useless.
Have you considered using modal divs instead? E.g. modal dialog from jQueryUI.
That is a problem that you can't avoid, popup blocking is a built in function that all the recent browsers have and getting around a pop-up blocker isn't going to get the user happy.
You can use a jquery/javascript alternative like on-request iframes or modal dialog windows
I know how to create alerts and confirm boxes, but what I cannot find out how to do is to do the actual clicking of OK. I have a page that pops up a confirm box. I want to click OK using a Java Script add-on. Basically, I want my code to click a link on the page, then click ok when prompted. Is that possible?
That's not possible with a browser pop-up.
However if it's a modal dialog that sits within the DOM of the page, then you can trigger a JavaScript event to close it. An example of such a dialog is jQuery's dialog.