javascript定时更换表格背景
<html>
<head>
<title>changePage</title>
</head>
<body>
<table id="pic" cellpadding="0" cellspacing="0" border="1" width="200" height="100" bordercolor="red">
<tr>
<td>picture chanage!</td>
</tr>
</table>
<script type="text/javascript">
<!--
window.onload=function()
{
changePicture();
}
var time=0;
function changePicture(){
time++;
document.getElementById('pic').background="images/"+time+".jpg";
if(time==3)
changePicture1();
else
setTimeout(changePicture,500);
}
function changePicture1(){
document.getElementById('pic').background="images/"+time+".jpg";
time--;
if(time==0)
changePicture();
else
setTimeout(changePicture1,10000); //设定时间
}
-->
</script>
</body>
</html>
相关文档:
要取什么值?
取value:getElementById("STB_433").value;
取状态(是否check):getElementById("STB_433").checked
取ID:getElementById("STB_433").id
...
var checkboxs=document.getElementsByTagName("input");
var i;
for(i=0;i<checkboxs.length;i++)
{
if(checkboxs[i].type=='checkbox')
{ ......
10、mootools.js的写类方式
mootools.js的最新版本是1.2.3,这里使用的是1.2.0。mootool被设计成非常紧凑的,模块化的,面向对象的的js库。mootool中写类用Class类。Class类由Native类new出来的:
/*
*Script: Class.js
*/
var Class = new Native({
name: 'Class',
initialize: function(properties){
propert ......
Do you want an ultra fast web site? Get JSL and optimize your JavaScript loading now!
Imagine there's a 4-lane highway between your web browser and the internet itself. This highway is optimize to let pictures, text, and css fly by. But, when it comes to external scripts, the highway crea ......
首先是十个JS FRAMEWORK
jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
jquery UI
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"></script>
Chrome Frame
<script src=& ......
s<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档< ......