如何将已打开的浏览器窗口置于顶部。 [英] How to bring already open browser window on top.

查看:836
本文介绍了如何将已打开的浏览器窗口置于顶部。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个软件,当我点击打印按钮时,会打开一个PDF格式的新窗口进行打印。



现在真正的问题是,我不关闭那个窗口,它在后台保持打开状态。因此,当我单击新打印按钮时,背景中的PDF会更新并保留在后台。



我想要的是每当我点击打印按钮时,

1)如果窗口未打开,则会显示打开和打印页面。

2)如果窗口已经打开,它会弹出并堆叠在我的屏幕上。



如果有任何进一步的问题请问我。

I am having a software in which when I click on print button, a new window opens up in PDF format for printing.

Now the real question is, I dont close that window & it stays open in background. Thus when I click on new print button, the PDF in background gets updated & stays in background.

What I wants is that whenever I click on print button,
1) If window not open, opens up & print page is displayed.
2) If window already open, it pops up & is stacked on top of my screen.

If any further question do ask me.

推荐答案

这不是一个好主意,有点过于干扰。我建议使用一种替代方法,单页面应用程序方法:

单页应用程序 - 维基百科,免费的百科全书 [ ^ ]。



不仅对用户不那么恼火并提供更好的用户体验,它还会为您省去很多麻烦。例如,您说:在这种情况下,将此窗口置于顶部。但你永远不知道,它是一个真正的浏览器窗口,还是只是其中一个标签。标签和单独窗口之间的选择完全取决于用户;和Web标准几乎忽略了差异,但浏览器实现的功能差异是显而易见的。当您处理单个页面时,您可以控制所有内容。您计划在不同的窗口中创建一个单独的,例如, div 在同一页面上,例如,可以停靠,取消停靠,隐藏或显示...



-SA
This is not a very good idea, a bit too intrusive. I would suggest using one alternative, the single-page application approach:
Single-page application - Wikipedia, the free encyclopedia[^].

Not only it would be not so irritating to the users and provide much better user experience, it will also save you from a lot of trouble. For example, you say: on this condition, put this window on top. But you never know, is it a real browser window, or just one of the tabs. The choice between tabs and separate windows is totally on the users; and Web standards pretty much ignore the difference, but the functional difference implemented by the browsers is apparent. When you work on a single page, you have everything under control. What you planned to make a different window will be just a separate, say, div on the same page, which can be, for example, docked, undocked, get hidden or shown…

—SA


这篇关于如何将已打开的浏览器窗口置于顶部。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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