现在的位置: 首页 > 综合 > 正文

如何动态控制弹出窗体的大小

2012年07月18日 ⁄ 综合 ⁄ 共 1270字 ⁄ 字号 评论关闭

目前需要在asp.net中实现一个这样的功能,跳出一个子窗体(模式)让客户选择内容,然后返回这个值
功能需要在IE5.5 和netscape7 上都完成
这个目前我做到了,代码在最后大家可以参考下
但弹出页面是和db相关,需要根据内容来调整窗体的大小,可是用
showModalDialog 打开的窗体就是没有办法在页面加载后调整,
那个大侠给支个照,我这里先谢谢了

var winModalWindow;

function selcolor(val)
{
   var info;
  if (val == "1")  info = document.forms[0].txtColorB.value;
  if (val == "2")  info = document.forms[0].txtColorA.value;

   if (navigator.appName != "Netscape")
   {
 // ret = showModalDialog('earring_custom.aspx?mode='+val+"&info="+info,parent,'dialogWidth:520px;dialogHeight:475px;center:yes;help:no;resizable:no;status:no');
  ret = showModalDialog('earring_custom.aspx?mode='+val+"&info="+info,parent,'dialogWidth:520px;dialogHeight:475px;center:yes;help:no;resizable:yes;status:no');
  }
  else
  {
  winModalWindow = val;
  window.open ('earring_custom.aspx?mode='+val+"&info="+info, 'ModalChild', 'dependent=yes,height=475, width=520, toolbar=no, menubar=no, scrollbars=no, resizable:yes,location=no, status=no');
  }

  if (ret==null) ret="N/A";
  if (val == "1")  document.forms[0].txtColorA.value=ret;
  if (val == "2")  document.forms[0].txtColorB.value=ret;
}

function nsSetValue()
{
 
  if (winModalWindow==null) ret="N/A";
  if (winModalWindow == "1")
  document.forms[0].txtColorA.value  = document.forms[0].hidetext.value;
  if (winModalWindow == "2")
  document.forms[0].txtColorB.value  = document.forms[0].hidetext.value;

}

抱歉!评论已关闭.