菜鸟高分请教:生成子窗口的方法,送分哦。。。。。。。。。。。。。

chengrong68 2003-10-15 11:02:25
我现在需使用windows.open()打开一个新的子窗口,按一定尺寸打开已经搞定,可是客户要求子窗口的大小是变化的,换句话说,就是窗口大小能根据窗体里的内容自动延伸。可以做的吗?
...全文
24 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
chengrong68 2003-11-19
  • 打赏
  • 举报
回复
up!
lishao 2003-11-18
  • 打赏
  • 举报
回复
up
flyjiebing 2003-11-18
  • 打赏
  • 举报
回复
up
chengrong68 2003-11-18
  • 打赏
  • 举报
回复
up
chengrong68 2003-11-18
  • 打赏
  • 举报
回复
up
falcon6666 2003-10-22
  • 打赏
  • 举报
回复
up
chengrong68 2003-10-22
  • 打赏
  • 举报
回复
哈,我的窗体是发DataGrid
rgbcn 2003-10-21
  • 打赏
  • 举报
回复
如果窗体里的内容容是文字的话,把文字的长度取出来。
然后把窗体的宽,设为文字的长度
chengrong68 2003-10-21
  • 打赏
  • 举报
回复
各位老大,不行啊,我想实现的是窗口的尺寸按实际内容的大小自动调整啊
coolpine 2003-10-16
  • 打赏
  • 举报
回复
top = (screen.height-imageNew.height)/2;
left=(screen.width-imageNew.width)/2;

window.open("ZoomOutPic.htm",strWinName,"width=" + imageNew.width + "px,height=" + imageNew.height + "px,top=" + top +"px,left=" + left + "px");
goody9807 2003-10-16
  • 打赏
  • 举报
回复
http://www.csdn.net/develop/Read_Article.asp?Id=15113
http://expert.csdn.net/Expert/topic/2001/2001793.xml?temp=.1702082
http://expert.csdn.net/Expert/topic/1911/1911975.xml?temp=.4667322
yaotiebing 2003-10-16
  • 打赏
  • 举报
回复
Response.Write("<script>window.open('page.aspx','new','fullscreen=0,toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width=800,height=600,top=0,left=0');</script>")
acewang 2003-10-16
  • 打赏
  • 举报
回复
resizable=yes
delphiseabird 2003-10-16
  • 打赏
  • 举报
回复
先统计一下记录又多长,再定窗口尺寸
xinyu_1980 2003-10-16
  • 打赏
  • 举报
回复
window.open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=no,width=400,height=350,left=' + (window.screen.width-400)/2 + ',top=' + (window.screen.height-350)/2 + ',screenX=100,screenY=50');
kwklover 2003-10-16
  • 打赏
  • 举报
回复
那么多代码啊?!
saucer 2003-10-16
  • 打赏
  • 举报
回复
in the opened page, try


<script language=javascript>
function window.onload()
{
var w = document.body.scrollWidth;
var h = document.body.scrollHeight;

if (w > 400)
w = 400;

if (h > 400)
h = 400;

window.resizeTo(w,h);
}
</script>

otherwise, you need to do it in the parent page:


<script>
var win = window.open("TestOpen2.html");
setTimeout("resizeChild()", 1000);

function resizeChild()
{
if (win != null && !win.closed)
{
if (win.document.readyState == "complete")
{
var w = win.document.body.scrollWidth;
var h = win.document.body.scrollHeight;

if (w > 400)
w = 400;

if (h > 400)
h = 400;

win.resizeTo(w,h);
}
else
{
setTimeout("resizeChild()", 1000);
}
}
}
</script>

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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