<body>
<script language="JavaScript">
<!--
var backImage = new Array();
backImage[0] = "pics/img02.jpg";
backImage[1] = "pics/img03.jpg";
backImage[2] = "pics/img04.jpg";
backImage[3] = "pics/img05.jpg";
function changeBGImage(whichImage){
if (document.body){
document.body.background = backImage[whichImage];
backImage = backImage++;
}
}
//-->
</script>
<a href="javascript:changeBGImage(2)">Change</a>
</body>
抱歉,我不明白我应该如何在此处正确集成代码 - 希望它仍然有效。我想在这里做什么:更改背景(有效)而不是在背景计数器上加一,以便下次单击链接时显示下一个背景(无效)。它应该很简单,但我还是想不通......