62,025
社区成员
发帖
与我相关
我的任务
分享
<!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>
function showDaTu(src){
document.getElementById("defaultImg").src=src;
}
</script>
</head>
<body>
<table border="0">
<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>
<script type="text/javascript" src="JS/jquery-1.4.3.min.js"></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>
<table border="1">
<tr>
<td>
<img src='image/pic/0-3ckZy0.jpg' width="50px" height="50"><br />
<img src='image/pic/01300000194882122148214747150.jpg' width="50px" height="50" ><br />
<img src='image/pic/05.jpg'width="50px" height="50" ><br />
<img src='image/pic/07.jpg' width="50px" height="50"">
</td>
<td>
<img src="image/pic/07.jpg" id="defaultImg" style=" width:100px; height:100px;">
</td>
</tr>
</table>
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)