如何强制浏览器窗口永远是顶部和焦点 [英] How do I force a browser window to always be on top and in focus

查看:1479
本文介绍了如何强制浏览器窗口永远是顶部和焦点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法强制浏览器窗口永远是在顶部和重点是什么?我工作的一个项目,我需要关闭浏览器窗口时,除了在顶部和聚焦所有的时间在浏览器窗口。我试图通过JavaScript的几件事情,但都没有成功保持窗口焦点。

Is there a way to force a browser window to always be on top and in focus? I am working on a project that I need to have the browser window on top and in focus all the time except when closing the browser window. I have tried a few things through javascript, but have not had any success keeping the window in focus.

我不是想这样做是有力给用户。我工作的一个项目,以实现在线测试,我不希望用户能够切换客场查找答案,在网络上。

I am not trying to do this to be forceful to the user. I am working on a project to implement online testing and I don't want the user to be able to switch away to look up answers on the web.

推荐答案

您需要安装客户机,这将强制浏览器在上面一个Windows应用程序。这是唯一的办法。

You will need to install a windows application on the clients machine which will force the browser to be on top. This is the only way.

如果您使用的是IE浏览器,可以打开一个模态对话框,将永远是顶部和焦点,但仅在该浏览器会话,用户可以自由切换应用程序。

If you are using IE, you can open a Modal dialog which will always be on top and in focus but only while in that browser session, the user is free to switch applications.

编辑:如果你正在写一个测试应用程序,您是关闭只是把在合理期限上的每个问题诚实地更好。试图prevent他们仰视的答案是毫无价值的。如果他们有并排两个机器的一面呢?如果他们有他们旁边的答案,帮助他们的伙伴。你将不得不去在这一个荣誉系统。

If you are writing a testing application, you are honestly better off just putting a reasonable time limit on each question. trying to prevent them from looking up the answers is worthless. What if they have two machines side by side? What if they have their buddy next to them helping with the answers. You are going to have to go with the honor system on this one.

这篇关于如何强制浏览器窗口永远是顶部和焦点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆