JavaScript 窗口. open 接受很多参数。 对于您的特殊案例, 顶端和左侧应该足够 。
见工作"http://jsfiddle.net/zuul/jB6AY/" rel="noreferrer" > fiddle example!
<强> 语法 强>
window.open([URL], [Window Name], [Feature List], [Replace]);
<强 > < 功能列表 强>
""https://i.sstatic.net/puu8x.jpg" alt="此处输入图像描述"/ >
适合您需要的工作示例
<script type="text/javascript">
<!--
function popup(url)
{
var width = 960;
var height = 1040;
var left = screen.width - 960;
var top = 0;
var params = width= +width+ , height= +height;
params += , top= +top+ , left= +left;
params += , directories=no ;
params += , location=no ;
params += , menubar=no ;
params += , resizable=no ;
params += , scrollbars=no ;
params += , status=no ;
params += , toolbar=no ;
newwin=window.open(url, customWindow , params);
if (window.focus) {newwin.focus()}
return false;
}
// -->
</script>
<a href="javascript: void(0)"
onclick="popup( popup.html )">Top Right popup window</a>
Note:
This will calculate the screen width to set the left
properly.
考虑到您使用的是高高的窗口, 通常屏幕大于高... em>