Please read my rational before downvoting.
I’m building a little web educational project where there is a section of art. Upon clicking a button, an element that contains a picture with an art piece will be showed. After that, I want another window to be opened with another website that has further or relevant information about the specific art piece(wikipedia, museums sites, virtual galleries, etc). I know that I could put another button to the link to the other website so that the user could click by themselves after looking at the art piece, but I would really like to achieve that feel of dynamicity and also put the user’s eyes on that relevant site after they’ve seen the art piece. Here is my code:
jQuery('a.artpiece').click(function(){
$(".photoContainer").show();
setTimeout(function() {
window.open("http://www.anotherartwebsite.com");
}, 6000);
});
Unfortunately the popup blocker is triggered since as you know the browser doesn´t take the window.open
function as a direct result of the user’s action since it is delayed a few seconds.
I have gone through a bunch of posts here where a workaround is made using Ajax to avoid the popup blocker, but since in this case I’m not using Ajax, I’m not sure if they would serve my purpose.
Thanks in advance.