ShowModalDialog用法的实例网页

分类: asp   出处:iocblog整理  更新时间:2009-11-18   添加到收藏  


  <html>
  <head>
  <title>showmodaldialog 方法</title>
  <meta http-equiv="content-type" content="text/html;charset=gb_2312-80">
  <style>
  body,td {font-size: 9pt}
  </style>
  <script>
  function fnrandom(imodifier){
  return parseint(math.random()*imodifier);
  }
  function fnsetvalues(){
  var iheight=oform.oheight.options[oform.oheight.selectedindex].text;
  if(iheight.indexof("random")>-1){
  iheight=fnrandom(document.body.clientheight);
  }
  var iwidth=oform.owidth.options[oform.owidth.selectedindex].text;
  if(iwidth.indexof("random")>-1){
  iwidth=fnrandom(document.body.clientwidth);
  }
  var itop=oform.otop.options[oform.otop.selectedindex].text;
  if(itop.indexof("random")>-1){
  itop=fnrandom(screen.height);
  }
  var ileft=oform.oleft.options[oform.oleft.selectedindex].text;
  if(ileft.indexof("random")>-1){
  ileft=fnrandom(screen.width);
  }
  var sedge=oform.oedge.options[oform.oedge.selectedindex].text;
  var bcenter=oform.ocenter.options[oform.ocenter.selectedindex].text;
  var bhelp=oform.ohelp.options[oform.ohelp.selectedindex].text;
  var bresize=oform.oresize.options[oform.oresize.selectedindex].text;
  var bstatus=oform.ostatus.options[oform.ostatus.selectedindex].text;
  
  var sfeatures="dialogheight: " + iheight + "px; dialogwidth: " 
  + iwidth + "px; dialogtop: " + itop + "px; dialogleft: " + 
  ileft + "px; edge: " + sedge + "; center: " + bcenter + "; 
  help: " + bhelp + "; resizable: " + bresize + "; status: " 
  + bstatus + ";";
  
  return sfeatures;
  }
  function fnopen(){
  /* the  method constructor looks like:
  showmodaldialog(
  surl="the page that is opened"
  sarguments="extra values or object references"
  sfeatures="features of the window";
  
  )
  */
  var sfeatures=fnsetvalues();(www.iocblog.net 文章来源)
  ofeatures.innerhtml=''window.showmodaldialog("smd_target.htm","'' + 
  oform.oarguments.value + ''","'' + sfeatures + ''");'';
  window.showmodaldialog("smd_target.htm", oform.oarguments.value, sfeatures)
  }
  </script>
  
  <!-- sample_style_start -->
  <link rel="stylesheet" href="/workshop/basicsdkie4.css"
  type="text/css">
  <!-- sample_style_end -->
  </head>
  <!--toolbar_start-->
  <!--toolbar_exempt-->
  <!--toolbar_end-->
  
  <body topmargin=0 leftmargin=0 bgproperties="fixed" bgcolor="#ffffff"
  link="#000000" vlink="#808080" alink="#000000">
  <blockquote class="body">
  
  <h1>showmodaldialog 用法</h1>
  <form name="oform">
  <fieldset><legend><b>showmodaldialog method options</b></legend>
  <table>
  <tr><td><label for=dheight>dialog窗口高度(数字)</label></td><td><select 
  id="dheight" name=oheight><option>-- random --<option>150<option>200<option>
  250<option>300<option>400<option>500</select></td></tr>
  <tr><td><label for=dwidth>dialog窗口宽度(数字)</label></td><td><select 
  id="dwidth" name=owidth><option>-- random --<option>150<option>200<option>
  250<option>300<option>400<option>500</select></td></tr>
  <tr><td><label for=dtop>dialog 窗口上距离(数字)</label></td><td><select 
  id="dtop" name=otop><option>-- random --<option>150<option>200<option>250
  <option>300<option>400<option>500<option></select></td></tr>
  <tr><td><label for=dleft>dialog 窗口左距离(数字)</label></td><td><select 
  id="dleft" name=oleft><option>-- random --<option>150<option>200<option>
  250<option>300<option>400<option>500<option></select></td></tr>
  <tr><td><label for=dcenter>dialog 窗口是否居中(yes时窗口左距离不能赋值}
  </label></td><td><select id="dcenter" name=ocenter><option>yes<option>no
  </select></td></tr>
  <tr><td><label for=dedge>dialog 样式</label></td><td><select id="dedge" 
  name=oedge><option>raised<option>sunken</select></td></tr>
  <tr><td><label for=dhelp>dialog 窗口是否显示帮助按钮</label></td><td>
  <select id="dhelp" name=ohelp><option>yes<option>no</select></td></tr>
  <tr><td><label for=dresize>dialog 窗口是否可控制大小</label></td><td>
  <select id="dresize" name=oresize><option>yes<option>no</select></td></tr>
  <tr><td><label for=dstatus>dialog 窗口是否显示状态栏</label></td><td>
  <select id="dstatus" name=ostatus><option>yes<option>no</select></td></tr>
  <tr><td><label for=darguments>dialog 窗口的标题</label></td><td><input
   type=text name=oarguments id="darguments" value="dialog 窗口标题"></td></tr>
  <tr><td><label for=dcommand>建立 dialog 窗口</label></td><td><input 
  id="dcommand" name=ocommand type=button value="建立窗口" onclick="fnopen()"></td></tr>
  <tr><td><b>代码:</b></td><td id=ofeatures></td></tr>
  <tr><td><b>注意:</b></td><td>* 只支持ie 5 以上的版本.</td></tr>
  </table>
  </form>
  </blockquote>
  </body>
  </html>
  
  (www.iocblog.net 文章来源)


Tag: showmodaldialog



文章整理:iocblog
版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。