<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>轮播图</title>
<link rel="stylesheet" href="css/Test4.css" />
<script type="text/javascript" src="js/jquery-1.8.3.js" ></script>
<script>
$(function(){
for(var i=2;i<10;i++){
$("#showImg").append('<img src="haizeiwang/'+i+'.png" width="113px" />');
}
var count = 0;
function fangda(){
// alert(123);
$("#showImg img").css("width","113px");
$("#showImg img").eq(count).css("width","200px");
count++;
if(count>=$("#showImg img").length){
count=0;
}
}
var obj = setInterval(fangda,500);
})
</script>
</head>
<body>
<div id="showImg">
<img src="haizeiwang/1.png" width="200px" />
</div>
</body>
</html>
网友评论