<script type="text/javascript">
function newopenbysize(url,target,width,height){
var info,winOpen,left,top;
left=(screen.width-width)/2;
if(left<0){ left=0;}
top=(screen.height-height)/2;
if(top<0){ top=0;}
info="toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no,";
info=info+"width="+width+",height="+height+",left="+left+",top="+top;
winOpen=window.open(url,target,tt);
}
</script>
<a href="javascript:;" onclick="javascript:newopenbysize('http://www.google.cn','_blank',500,500)">google</a>
function newopenbysize(url,target,width,height){
var info,winOpen,left,top;
left=(screen.width-width)/2;
if(left<0){ left=0;}
top=(screen.height-height)/2;
if(top<0){ top=0;}
info="toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no,";
info=info+"width="+width+",height="+height+",left="+left+",top="+top;
winOpen=window.open(url,target,tt);
}
</script>
<a href="javascript:;" onclick="javascript:newopenbysize('http://www.google.cn','_blank',500,500)">google</a>

本文介绍了一个使用JavaScript编写的函数newopenbysize,该函数用于在一个指定大小的新窗口中打开特定URL。通过调整窗口的位置和尺寸,可以实现良好的用户体验。
1528

被折叠的 条评论
为什么被折叠?



