javascript开发系列(框架、窗口)
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、移动窗口
var x=0;
var y=0;
function moveWin() {
((x + 0) < (window.screen.width + 0)) ? (x = x + 1) : x = 0;
((y + 0) < (window.screen.height + 0)) ? (y = y + 1) : y = 0;
window.moveTo(x, y);
setTimeout("moveWin()", 1);
}
相关文档:
1: 遍历并输出Table中值
<table id="tb">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</ ......
<html>
<body>
<style>
ul,li{margin: 0; padding: 0;width:100%;}
</style>
<script language="javascript" type="text/javascript">
function checkword()
{
var wordvalue=document.getElementById("word").value.toLowerCase();
var alltxt="管理员| ......
JavaScript A Beginner's Guide 3rd Edition
锋利的jQuery
精通Dojo
Using The Dojo JavaScript Library To Build Ajax Applications
Professional JavaScript For Web Developers 2nd Edition
......
JavaScript代码
<mce:script type="text/javascript"><!--
function imageOver(e) {
e.style.border="1px solid red";
}
function imageOut(e) {
e.style.borderWidth=0;
}
// --></mce:script>
<img src="phplamp.gif" onmouseover="imageOver(this)" onmo ......
javascript中的面像对像。
请看代码,下面弹出一个对话筐。
<script type="text/javascript">
function win(w, h,,url)
{
this.widt ......