如何将新开窗体的大小设置为屏幕的大小???

Sunny_Yirui 2003-08-11 11:09:26
如:1024X768 则新开窗口为1024X768
800X600 则为800X600

用window.open实现。

谢谢!!
...全文
74 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
nba23 2003-08-11
  • 打赏
  • 举报
回复
<script>
<!--
function winopen(){
var targeturl="http://*****"
newwin=window.open("","","scrollbars")
if (document.all){
newwin.moveTo(0,0)
newwin.resizeTo(screen.width,screen.height)
}
newwin.location=targeturl
}
//-->
</script>
<input type="button" onClick="winopen()" value="xxxx">
f2k 2003-08-11
  • 打赏
  • 举报
回复
<script language="javascript">
if (document.layers){
var larg=screen.availWidth-10;
var altez=screen.availHeight-20;}
else{
var larg=screen.availWidth+8;
var altez=screen.availHeight+7;}
self.resizeTo(larg,altez);
self.moveTo(-4,-4);
window.moveTo(-4,-4)
window.resizeTo(screen.availWidth+9,screen.availHeight+9)
</script>
Jaron 2003-08-11
  • 打赏
  • 举报
回复
<SCRIPT LANGUAGE="JavaScript">
<!--
var str = "left=0,screenX=0,top=0,screenY=0,fullscreen=yes";//fullscreen=yes只对IE有效!

if (window.screen) {
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
str += ",height=" + ah;
str += ",innerHeight=" + ah;
str += ",width=" + aw;
str += ",innerWidth=" + aw;
} else {
str += ",resizable"; // 对于不支持screen属性的浏览器,可以手工进行最大化。 manually
}

function launchFull(url, name) {
return window.open(url, name, str);
}

var win = launchFull("http://expert.csdn.net", "full");

// -->
</SCRIPT>
Sunny_Yirui 2003-08-11
  • 打赏
  • 举报
回复
ding
Sunny_Yirui 2003-08-11
  • 打赏
  • 举报
回复
谢谢各位了!!
fason 2003-08-11
  • 打赏
  • 举报
回复
<script>
window.open("about:blank","","channelMode")
</script>
fason 2003-08-11
  • 打赏
  • 举报
回复
<script>
window.open("about:blank","","channelMode")
</script>
fason 2003-08-11
  • 打赏
  • 举报
回复
<script>
window.open("about:blank","","channelMode")
</script>
eliphe 2003-08-11
  • 打赏
  • 举报
回复
<script>
<!--
function winopen(){
var targeturl="http://*****"
newwin=window.open("","","scrollbars")
if (document.all){
newwin.moveTo(0,0)
newwin.resizeTo(screen.width,screen.height)
}
newwin.location=targeturl
}
//-->
</script>
<input type="button" onClick="winopen()" value="xxxx">

87,987

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧