首先在body中加入以下HTML内容:
<div id="panel">
<div id="top">
<ul id="menu">
<li id="1">Home</li>
<li id="2">IntelligenceFacts</li>
<li id="3">Research</li>
<li id="4">Perception</li>
<li id="5">Robotics</li>
<li id="6">Cognitive Science</li>
</ul>
</div><!-- END #top -->
<div id="main">
<div class="show" id="d ......
< HTML >
< HEAD >
< TITLE > 合同申请 </ TITLE >
< meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" >
< SCRIPT LANGUAGE = JavaScript >
/* * Define object Dsy 构造器
fieldValues - 三个表单域的名称, 可以通过 request.getParameter(xxx) 取值
defalutOptions - 默认选项
*/
function Dsy(fieldValues, defalutOptions){
this .Items = {};
this .defalutOptions = defalutOptions; // 默认选项
this .fieldValues = fieldValues; // 三个表单域的名称
}
Dsy.prototype.add = function (id, iArray){
this .Items[id] = iArray;
}
Dsy.prototype.Exists = function (id){
if ( typeof ( this .Items[id]) == " undefined " )
re ......
window,是javascript中整个框架中的根。它具有如下属性和方法:
属性:location,navigate,screen,frameset[],document,history等6个重要的属性.
方法:setTineOut(),moveTo(),moveBy(),resizeBy(),resizeTo()等几个常用的方法。
请看如下两个例子:
1、状态栏动态显示年月日
function setTime() {
var dt = new Date();
var strSt = dt.getFullYear() + "年" + (dt.getMonth()+1) + "月" + dt.getDate() + "日" + dt.getHours() + "时" + dt.getMinutes() + "分"+dt.getSeconds()+"秒";
//window.defaultStatus = strSt;
window.status = strSt;
setTimeout("setTime()", 1000);
}
2、 ......
opener.window表示打开它的原框架。
top表示顶部框架,
parent引用包含这个窗口的window对像
例子如下;
a.htm页面
<!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>
<script type="text/javascript">
function a(url,w,h) {
var x = window.screen.availWidth/2-w;
var y = window.screen.availHeight/2-h;
var str = "height="+h+",width="+h+",top="+y+",left="+x+",toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no";
window.open(url, "_blank", s ......
This tool will let you optimize your JavaScript (JScript) code by removing comments, whitespace as well as other unnecessary characters as well as by optionally shortening function / variable / class names.
http://www.xtreeme.com/javascript-optimizer/ ......
<!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>
<title>JavaScript真正的鼠标放上动画加载大图的代码</title>
<style>
*{ padding:0; margin:0;}
html { overflow:-moz-scrollbars-vertical; }
body{ word-break:break-all; text-align:left; background:#C0C0C0; color:#4E4E4E;}
ul,li{ list-style:none;}
a{ color:#333; text-decoration:none;}
a:hover{ color:#ff722d; text-decoration:none;}
img{ border:0;}
a img,a:hover img{ border:0;}
.latestWeb{ width:560px; margin:10px auto 0;}
.latestWeb ul{ overflow:hidden; _height:1%;}
.latestWeb li{ float:left; border:1px solid #EBEAEA; width:150px; padding:17px 0 14px 22px; margin:14px 18px 0 0; }
.trans_msg
{
filter:alpha(opacity=100,enabled=1) revealTrans(duration=.2,transition=1) blendtrans(duration=.2);
}
div.bodycontent{font-family:Arial, Helvetica, sans-serif;padding:0 10px ......