1

Here is an example page: http://vincent-massaro.com/modal/modaltest.html

I am trying to have a window open with Jquery when a link is clicked, but delay the popup so that a message is first displayed before the popup happens. As you can see from the example the window.open happens not on the click, but on the fade, so this triggers a popup blocker because it is not being triggered by the user click input. Is it possible to move the window.open and delay it so that when the link is clicked, the window.open and the modal message fire off at the same time, but the window.open is delayed 5 seconds so that it doesn't trigger the popup blocker? Thanks!

2 Answers 2

2
setTimeout(function() {

// window.open call

}), 5000 );

It won't be an accurate 5 seconds, it depends on how busy the browser is. But accurate enough. Put that in your .click fn.

Sign up to request clarification or add additional context in comments.

2 Comments

Can you modify my source? Javascript newbie here and I'm not sure exactly what you mean. Thanks.
I was able to get your code working, but it is still triggering the popup blocker in Firefox, Chrome, and Safari. Any other ideas? vincent-massaro.com/modal/modaltest.html#
0

Haven't tried it, but put the window.open in a timeout function and bind it separately to the link.

1 Comment

Turned out this is not possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.