Pop-up advertising is nothing new to the web; we’ve been fluently closing free iPod offers for years now. However, the latest breed of these attempts to be less intrusive by popping under the current browser instead, with the intention of you not seeing the ad until you’ve closed the browser window. Fellow Mac users probably see the fault in this logic (since after a typical browsing session, you’d hit Apple-Q, which kills all browser windows at the same time), but nevertheless the technique is growing in popularity, and you might be wondering how to do it.
Fortunately, this is a VERY simple technique which can be cross-browser friendly with only two Javascript commands:
// specify the destination and window size
function popUnder(url, height, width) {
// spawn the new window using blur() to attempt to
// force the window into the background
window.open(url,
'width='+width
+',height='+height
+',left=200,top=200'
).blur();
// force this window into the foreground (to cover
// any browsers that were unresponsive to blur()
window.focus();
}
And that’s it — you can now be on the road to being a more subtle nuisance. =)
Chris said
Hi.
Can this work on WordPress blogs? If yes, then where do I add this code?
Thanks