<script language="javascript"> function manage()...{ var hdc=window.open('Default2.aspx','','width=300,height=200'); width=screen.width; height=screen.height; hdc.moveTo((width-300)/2,(height-200)/2); } </script>
弹出窗口,有点auto性质
<title>弹出网页模式对话框</title> <script language="javascript"> function opendialog() ...{ var someValue=window.showModalDialog("Default2.aspx","","dialogWidth=300px;dialogHeight=200px;status=no;help=no;scrollbars=no") document.form1.TextBox1.value=someValue; } </script>
全屏模式代码
<script language="javascript"> function opendialog()...{ var width=screen.width; var height=screen.height; window.showModalDialog("Default.aspx","","dialogWidth="+width+"px;dialogHeight="+height+"px;status=no;help=no;scrollbars=no") } </script>
取色器代码
<%...@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>无标题页</title> </head> <body> <script language="JavaScript">... <!-- var h =new Array(6) h[0] ="FF"; h[1] ="CC"; h[2] ="99"; h[3] ="66"; h[4] ="33"; h[5] ="00"; function action(RGB) ...{ //alert('您选择的颜色是:#'+RGB); parent.window.returnValue="#"+RGB; window.close(); } function Mcell(R, G, B) ...{ document.write('<td bgcolor="#'+ R + G + B +'">'); document.write('<a href="#" onClick="action(''+ (R + G + B) +'')">'); document.write('<img border=0 height=12 width=12 ')" alt='#'+R+G+B+''>'); document.write('</a>'); document.write('</td>'); } function Mtr(R, B) ...{ document.write('<tr>'); for (var i =0; i <6; ++i) ...{ Mcell(R, h[i], B); } document.write('</tr>') } function Mtable(B) ...{ document.write('<table cellpadding=0 cellspacing=0 border=0>'); for (var i =0; i <6; ++i) ...{ Mtr(h[i], B); } document.write('</table>'); } function Mcube() ...{ document.write('<table cellpadding=0 cellspacing=0 border=0><tr>'); // for (var i =0; i <6; ++i) ...{ if(i%3==0)...{ document.write('<tr>'); } document.write('<td bgcolor="#FFFFFF">'); Mtable(h[i]) document.write('</td>'); } if(i%3==0)...{ document.write('</tr>'); } document.write('</tr></table>'); } Mcube() --> </script> </body> </html>