我正在使用下面的Java脚本代码来创建幻灯片与图像 img1.jpg,img1.jpg和img3.jpg。 但它在输出中只显示img1.jpg。请告诉问题。幻灯片javascript不工作
<html>
<style>
#slideshow{width:310;height:210;border-style:solid;}
#slideshow>img{position:absolute;left:15;top:15}
</style>
<body>
<div id="slideshow">
<img id="imge" src="img1.jpg" height="200" width="300">
</div>
<script>
var count=2;
function mf()
{
document.getElementById("imge").src="img"+count+".jpg";
document.getElementById("imge").height="200";
document.getElementById("imge").width="300";
if(count<3)
count++;
else
count=1;
setTimeout("mf()",3000);
}
</script>
</body>
</html>
你还没有在任何地方调用'mf'函数。 – tewathia
哦......我多么傻......谢谢 – user2828552