给轮播的图片加超链接
<!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 src="css/jquery-1.4.1.min.js" type="text/javascript"></script>
<script>
function showDaTu(src){
document.getElementById("defaultImg").src=src;
}
</script>
<script>
$(document).ready(function() {
var index = 0;
var count = $("table tr").eq(0).find("td img").length;
setInterval(function(){
$("#defaultImg").attr("src",$("table tr").eq(0).find("td img").eq(index).attr("src"));
if(++index>=count){
index=0;
}
},3000);
});
</script>
</head>
<body>
<table border="0">
<tr>
<td width="0">
<div id="ddd" style="display:none;">
<img src='images/06.jpg'>
<img src='images/07.jpg'>
<img src='images/08.jpg'>
<img src='images/09.jpg'>
<img src='images/10.jpg'></div>
</td>
</tr>
<tr>
<td>
<img src='images/01.jpg' onmouseover="showDaTu('images/06.jpg')"><br />
<img src='images/02.jpg' onmouseover="showDaTu('images/07.jpg')"><br />
<img src='images/03.jpg' onmouseover="showDaTu('images/08.jpg')"><br />
<img src='images/04.jpg' onmouseover="showDaTu('images/09.jpg')">
</td>
<td>
<img src="images/10.jpg" id="defaultImg">
</td>
</tr>
</table>
</body>
</html>
<a href="2"><img id='img2' src='images/02.jpg' /></a><br />
<a href="3"><img id='img3' src='images/03.jpg' /></a><br />
<a href="4"><img id='img4' src='images/04.jpg' /></a>
</td>
<td width="200px" height="100px">
<a id="defaulta"><img src="images/10.jpg" id="defaultImg" /></a>
</td>
</tr>
</table>
<script type="text/javascript">
var index=0;
var count=document.getElementById("td1").getElementsByTagName("img").length;
if(count>0)
{
setInterval(showDaTu,1000);
}
function showDaTu()
{
var defaultImg=document.getElementById("defaultImg");
var defaulta=document.getElementById("defaulta");
defaultImg.src=document.getElementById("td1").getElementsByTagName("img").item(index).src;
defaulta.href=document.getElementById("td1").getElementsByTagName("a").item(index).href;
if(++index>=count)
{
index=0;
}
}
</script>
这次你在不给分,我举报你。