JavaScript 图片广告切换

来源:百度知道 编辑:UC知道 时间:2024/05/19 04:50:42
<!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>多张图片轮换广告 </title>
<script language="javascript">
var NowFrame = 1;//定义当前图片
var MaxFrame = 3; //定义图片张数
function show(){
var next = NowFrame + 1; // 这里的定义的变量next 代表什么
if(next == MaxFrame+1){ // 存在 MaxFrame+1这张图片吗???? MaxFrame 不已经就是图片的张数了吗? 它在加1代表什么啊?
NowFrame = MaxFrame;
next = 1; //next=1的作用是什么?
}
{
document.getElementById(

if(next == MaxFrame+1){ // 存在 MaxFrame+1这张图片吗???? MaxFrame 不已经就是图片的张数了吗? 它在加1代表什么啊?
NowFrame = MaxFrame;
next = 1; //next=1的作用是什么?
}

----------

if(next > MaxFrame){ // 判断是否超过N张图片
NowFrame = MaxFrame;
next = 1; //next=1如果超过则重置为1
}

-----
'div'+next代表

id="div1"
id="div2"
id="div3"

中的一个