<!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=utf-8" />
<title>图片自动切换+链接</title>
<script src="js/Carousel.js" type="text/javascript"></script>
<script type="text/javascript">
setInterval(test,3000);
var array=new Array();
var index=0;
var array= new Array("images/1.jpg","images/2.jpg","images/3.jpg");
function test()
{ var myimg=document.getElementById("imgs");
var mya=document.getElementById("as")
if(index==array.length-1)
{ index=0; }else{ index++; }
myimg.src=array[index];
}
setInterval(test1,3000);
var array1=new Array();
var index1=0;
var array1= new Array("#","#","#");
function test1()
{var mya=document.getElementById("as")
if(index1==array1.length-1)
{index1=0;}else{index1++;}
mya.href=array1[index1];
}
</script>
</head>
<body>
<div class="lb" style="margin:20px auto 0;1200px;height:100px;">
<a href="#" id="as"><img id="imgs" src="images/1.jpg" /></a>
</div>
</body>
</html>