日期:2014-05-16 浏览次数:20394 次
<head>head的一部分代码
<script type="text/javascript" language="javascript">
var li = document.getElementsByTagName("li");
function zidong(){
if(a==0)document.getElementsByTagName("img")[0].src = "01.jpg";
document.getElementsByTagName("img")[0].src = document.getElementsByTagName("img")[a].src;
if(a == 4){a=0;}
else if(a<4){a+=1;}
}
window.onload = function (){
li[0].onmouseover = function (){genghuan(0);}
li[1].onmouseover = function (){genghuan(1);}
}
</script>
</head>
<body>但是这里的
<script>
var turn = setInterval(zidong,1000);
li[0].onmouseover=function() {clearInterval(turn);}
li[1].onmouseover=function() {clearInterval(turn);}
</script>
</body>
li[0].onmouseover=function() {clearInterval(turn);}不好使了
<!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>
<style>
#tupian01
{
position:absolute;
width:180px;
height:260px;
overflow:hidden;
left: 360px;
top: 20px;
}
#anjian01
{
position:absolute;
left: 360px;
top: 300px;
}
#number01
{
position:absolute;
left: 35px;
top: 225px;