问题
Possible Duplicate:
Popup window always on top
In my web application, there is a button that opens a score chart. The chart is opened as a new window, so that the user can put it adjacent to the main window:
javascript:window.open('chart',..., 'left=50,top=50,toolbar=no,location=no,status=no,directories=no,dependent=yes,menubar=no, width=400,height=600,scrollbars=yes')
However, when the user makes his main window full-screen, and then opens the score chart, and then clicks the main window - the score chart "disappears" under the main window.
How can I make the score chart stay always at the top (until the user closes it, of course)?
Other ideas to achieve the same goal will also be welcome...
回答1:
You can use jquery dialog to open the window as a "window" inside your main window that way the main window and the score chart are the same..
var $div = $("<div/>");
$("#OpenScoreChartButton").click(function() {
$div.load('chart.aspx?... ', function() {
$div.dialog();
});
});
回答2:
What about making a div positioned on top of the page instead of a browser window? Popup windows are usually prevented as default by browsers. One way to achieve this would be using a javascript plugin like this one: https://github.com/ajayhada/SimpleDialog/wiki, or maybe Jquery UI Dialog, see http://jqueryui.com/dialog/
来源:https://stackoverflow.com/questions/14565310/create-a-window-that-always-remains-on