⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cook26.htm

📁 javascript各种效果的实例及源代码
💻 HTM
字号:
<html>
<head>
<title>定制打开的窗口</title>
<style type="text/css">
<!--
body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none }
 A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript"> 
<!-- 
function win() {
var h= document.winfrm.hig.value
var w= document.winfrm.wid.value
testWindow=window.open("about:blank",'testwin','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h +'');
testWindow.document.writeln("<head><title>这是一个测试窗口</title></head>");
testWindow.document.writeln("<body bgcolor=#ffffcc>");
testWindow.document.writeln("该窗口已经按照你要求的大小打开了!<p>");
testWindow.document.writeln("如何使用就在于你的创意了!</body>");
testWindow.document.writeln('');
}
// --> 
</script>
</head>

<body bgcolor="#fef4d9">
<br>
<br>
<center><font color=red face="隶书" size=6>定制打开的窗口</font></center>
<br>
<center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=4 color=red face="Arial, Helvetica, sans-serif"><strong>下面请输入相应数值!</strong></font></td></tr>
<tr><td align=center><form name="winfrm">
窗口宽度: 
<input type="text" name="wid" maxlength="3">
<br>
窗口高度: 
<input type="text" name="hig" maxlength="3">
<br>
<input type="button" name="s" value="开始测试" onClick="win()" class="yk9">
</form></td></tr>
</table></center>
<br>
<br>
<center>
<textarea name=source rows=12 cols=45 class=yk9>
脚本说明:
第一步:把如下代码加入<head>区域中
<script language="JavaScript"> 
<!-- 
function win() {
var h= document.winfrm.hig.value
var w= document.winfrm.wid.value
testWindow=window.open("about:blank",'testwin','toolbar=no,location=no,directories=no,menubar=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h +'');
testWindow.document.writeln("<head><title>测试窗口</title></head>");
testWindow.document.writeln("<body bgcolor=#ffffcc>");
testWindow.document.writeln("该窗口已经按照你要求的大小打开了!<p>");
testWindow.document.writeln("如何使用就在于你的创意了!</body>");
testWindow.document.writeln('');
}
// --> 
</script>

第二步:把如下代码加入<body>区域中
<form name="winfrm">
窗口宽度: 
<input type="text" name="wid" maxlength="3">
<br>
窗口高度: 
<input type="text" name="hig" maxlength="3">
<br>
<input type="button" name="s" value="开始测试" onClick="win()" class="yk9">
</form>
</textarea>
<SCRIPT LANGUAGE="JavaScript">

<!-- hide

function goHist(a) 

{

   history.go(a);

}

//-->

</script>

<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">
</form>
</center>
<br>
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -