我创建了这个网站,它使用一个简单的javascript函数来显示基于用户鼠标移动或单击右侧编号框的图像。现在经过测试,已经确定应该在其上添加自动幻灯片放映,以便在几秒钟后显示下一张图片。Javascript自动下一张图片
http://www.philippedollo.com/photo/fineart/f_amw.htm
有没有一种方法可以轻松地修改这个代码,使其极易发生? -
function showPic(whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
} else {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}
}
尝试使用jQuery,它会更容易。 – 2011-06-06 13:24:29