First of all you're quoting me out of context. If a new window or tab is opened, the browser's popup blocker will block it.
However, I played around with it some more and found that a new window could be opened ahead of time, before the animation, while the browser still thinks it's a normal link. That new window can then be shifted to the background. The animation can play out, then that existing new window can be populated with the new page without arousing the popup blocker.
But, this only really works well in IE. But that's all you asked for.
In Firefox it works, but is jerky. The initial new window sticks around too long before it loses focus. In others like Chrome, Safari, Opera, focus cannot be given to nor taken away from windows, so the animation takes place, but you never see it, it's behind the new window.
Even in IE it must be a new window, as IE will not allow focus to be given to nor taken away from a tab in the same window. And even IE can sometimes be a little slow to have the initial new window lose focus, but in my tests, not too bad.
And in any browser, if the popup blocking settings are high, the initial new window will be blocked. The default popup blocking settings in all browsers will allow the initial new window though.
That all said, put this file named newwin.htm in the same folder as the page:
HTML Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
opener.focus();
</script>
</head>
<body>
</body>
</html>
And use this updated version of the script:
Attachment 4536
I've done only limited testing to see how it works if the target is a frame or iframe, it looks like it would probably still work, and should work in the normal manner if there is no target specified. But I've not tested that thoroughly either.
I have tested it with target="_blank" in IE 9 though and it works fine in that browser, so should work in other IE which are generally less strict about popups and windows.
I also tested it that way in those other browsers, which is why I know it's problematic in them. It still 'works'. It's just that the animation is either completely or partially missed.
The browser cache may need to be cleared and/or the page refreshed to see changes.
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
Another thing to consider is:
Do you really need a new window? You could populate an iframe or frame on the page or even fetch same domain content via AJAX to a div on the page.
None of these would be blocked (with the exception of pages that don't allow themselves to be in iframes or frames) and the animation could play out first with no problem.
Bookmarks