我正在寻找一些帮助,我的JavaScript幻灯片,其中的代码是从互联网上的教程中使用的。我想基本做到这一点,当你将鼠标移到它上面时,图像就不会改变。另外,我想在幻灯片的底部有两个按钮,例如下面的图片。Javascript幻灯片点击按钮
http://imageshack.us/photo/my-images/841/slideshowexample.jpg/
<img src="/wp-content/themes/twentyten/images/slide1.jpg" name="slide" />
<script>
<!--
//variable that will increment through the images
var step=1
function slideit(){
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
//call function "slideit()" every 5 seconds
setTimeout("slideit()",5000)
}
slideit()
//--></div></script>
在此先感谢, 尼克。
嗯...我认为你所遵循的教程是在90年代写的,它几乎所有的东西都是错误的。 – 2011-06-07 19:31:11
'//如果浏览器不支持图像对象,退出.'哟,这是非常古老的。你应该考虑使用更新和更灵活的东西,也许[link](http://jqueryfordesigners.com/jquery-infinite-carousel/)甚至[link](http://colorpowered.com/colorbox/) - 我不认为你会让任何人为你写幻灯片。 – changokun 2011-06-07 19:54:07