开发者

Alternative to blur() for setting window focus?

I am using a little bit of Javascript to set the focus of a window to the background. I am asking a user if they want to take a survey. If so, the survey window should fall behind the active window so they can continue to surf the sit开发者_高级运维e unabated. The JS works fine, except for in Chrome (and probably Safari).

Here's the JS:

window.onload = function()
{
  self.blur();
};

Is there a better way to do this that has better browser acceptance?


To my knowledge, there is no standard or reliable way to force the window manager to position a popup window below its parent on all platforms.

If you're into unobtrusive surveys, you might want to consider implementing something like StackOverflow's notification bar, and opening your popup window in the foreground only if the user interacts with that element.


Looks like you have the survey window in front of another window, and want it to go behind that window if user elects to take the survey. Try this:

<BODY onLoad="self.blur()">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜