图像不会在javascript幻灯片中显示,我已经在这上面工作了三天,我对此感到厌烦。我甚至开始作弊,只是复制我在网上看到的其他滑块(开源)并使用它们。这是工作用的,请帮帮我。
<div id="slideshow" style="width:960px;height:500px;overflow:hidden;">
<div id="slideshowimage" style="width:960px;height:500px;overflow:hidden;">
</div>
<div id="slideshowcontrols" style="width:960px;height:500px;overflow:hidden;">
<a onClick="alterimage(-1);">Prev</a>
<a onClick="alterimage(1);">Next</a>
</div>
</div>
<script type="text/javascript">
var images = new Array;
images[1] = "Images/image1.jpg";
images[2] = "Images/image2.jpg";
images[3] = "Images/image3.jpg";
var presentimage = 1;
function alterimage(alter){
presentimage += alter;
document.getElement('slideshow').innerHTML = presentimage;
}
alterimage(0);
</script>发布于 2013-12-31 05:28:39
没有getElement这样的函数,应该是getElementById
document.getElementById('slideshow').innerHTML = presentimage;https://stackoverflow.com/questions/20847828
复制相似问题